Skip to content
Browse files
fixing sudoku graph coloring testcase
  • Loading branch information
ameyjadiye committed Jun 13, 2020
1 parent 9bc2fff commit 6f29688dd2e7e4d89fdd5863a4da1bddf4557e3b
Showing 1 changed file with 6 additions and 1 deletion.
@@ -189,8 +189,13 @@ public void testSudoku()
new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
buildSudokuGraph( g1 );

//Optimal solution is to use 9 colors, not all algorithms can find solution with minimal colors.
//greedy algorithm needs 13 colors to fetch solution ATM.

Set<Integer> col = createColorsList( 9 );

ColoredVertices<BaseLabeledVertex, Integer> sudoku =
coloring( g1 ).withColors( colors ).applyingGreedyAlgorithm();
coloring( g1 ).withColors( col ).applyingBackTrackingAlgorithm();
checkColoring( g1, sudoku );

0 comments on commit 6f29688

Please sign in to comment.