diff --git a/tests/edu/caltech/cs2/project06/DSaturTests.java b/tests/edu/caltech/cs2/project06/DSaturTests.java index 36093bcabfb884175a2a1d5f10acfd28ac5db0b0..5a2a579093ffbac41923a23e7ba7e7c73d1a1693 100644 --- a/tests/edu/caltech/cs2/project06/DSaturTests.java +++ b/tests/edu/caltech/cs2/project06/DSaturTests.java @@ -157,12 +157,14 @@ public class DSaturTests { checkValidNColoring(g, K); } - @Test @Tag("B") - @DisplayName("Test DSatur on wheel graph (guaranteed optimal)") - public void testWheel() { - int K = 6; - NodeGraph g = new NodeGraph(K + 1); + @DisplayName("Test DSatur on various wheel graphs (guaranteed optimal)") + @ParameterizedTest(name = "Test DSatur on wheel graph with {0} vertices") + @CsvSource({"6","7","8","9","10","25","100","501","1000"}) + public void testWheel(int T) { + // K is number of outer vertices + int K = T-1; + NodeGraph g = new NodeGraph(T); for (int i = 0; i < K + 1; i++) { g.addEdge(i % K, (i + 1) % K); } @@ -171,7 +173,13 @@ public class DSaturTests { } DSatur.color(g); - checkValidNColoring(g, 3); + int maxColors; + if (K % 2 == 0){ + maxColors = 3; + } else { + maxColors = 4; + } + checkValidNColoring(g, maxColors); } @Tag("B")