def test_degree0(self): for i in range(3): V, E = generate_graph_of_degree(0) Ec = complement(V, E) expected = len(naive(V, Ec)) actual = maxset(V, E) self.assertEqual(expected, actual)
def test_graph_of_degree_n(self): for i in range(20): V,E = fun.generate_graph_of_degree(i) for v in V: self.assertLessEqual(fun.degree(v, V, E), i)