0
$\begingroup$

Say I have a 2D grid of squares, and I need to assign a unique ID value to each of the squares. I want to assign IDs such that the difference in value between any two adjacent squares is as small as possible.

Are there any rules for performing this assignment, and are there any guarantees to the upper bound of the maximum difference, given the number of assigned values? Is there a 3d analogue?

Thanks!

$\endgroup$
2
  • $\begingroup$ What limitations are given about the set of IDs? $\endgroup$ Commented Dec 1, 2015 at 0:12
  • $\begingroup$ They're integers. They have to be unique. Each square gets one ID. $\endgroup$ Commented Dec 1, 2015 at 2:37

0

You must log in to answer this question.

Browse other questions tagged .