156157158159160161162163164165166
for (int i = 2; i < nodes; i++) { graph.addEdge(1, i); } Assert.assertEquals("wrong degeneracy", 2, graph.degeneracy()); } @Test public void testUndirectedClear() {
261262263264265266267268269270271
for (int i = 0; i < nodes; i++) { for (int j = i + 1; j < nodes; j++) { graph.addEdge(i, j); } } Assert.assertEquals("wrong degeneracy", nodes - 1, graph.degeneracy()); } @Test public void testUnDirectedDegeneracy3() {
331332333334335336337338339340341
{ 44, 51 }, { 47, 50 }, { 47, 51 }, { 48, 51 }, { 49, 50 } }; for (int i = 0; i < edges.length; i++) { graph.addEdge(edges[i][0], edges[i][1]); } Assert.assertEquals("wrong degeneracy", 9, graph.degeneracy()); } @Test public void testJSON() {