I posted a programming puzzle years back, and someone named Hakan Kjellerstrand pointed out that the problem leant itself to constraint programming and posted a solution in Minizinc.
Here's the puzzle page: https://gcanyon.wordpress.com/2009/10/28/a-programming-puzzl...
And the solution in Minizinc: http://www.hakank.org/minizinc/einav_puzzle.mzn
And my solution in J: https://gcanyon.wordpress.com/2009/10/30/a-solution-to-einav...