Optimal Assignments of Numbers to Vertices