Prove that a NxN grid can be colored using n colors such that each color appear once each row and column

discrete mathematicsgraph theory

Just like a simpler Sudoku game, given n, show that nxn grid can be colored using n colors so that each color appears once for each row/column.

I see that each row/column forms a complete graph so that we need at least n colors for each row/column. But I'm stuck at bringing those together and show that n is also the maximum color needed to color the grid.

Any hint? Thanks!

EDIT: I forgot to add 1 more constraint that I would need to prove also for the case that k (k less than n) row is already given. I think in that case the shifting answer would not be correct right?

Best Answer

Give the squares of the grid coordinates $(x,y)$ where $0 \leq x, y \leq n-1$. Give the square $(x,y)$ colour $i$ where $0\leq i \leq n-1$, and $x+y \equiv i \pmod n$. This colouring satisfies the conditions required.

Related Question