Beispiel #1
0
 def testKColor(self):
     g = DalGraph(make_cycle(3))
     c = g.k_color()
     self.assertEqual(3, c, "KColor: K3 case")
     g = DalGraph(make_cycle(4))
     c = g.k_color()
     self.assertEqual(None, c, "KColor: C4 case")
     g = DalGraph(make_wheel(6))
     c = g.k_color()
     self.assertEqual(4, c, "KColor: W6 case")
     c5 = make_cycle(5)
     c5_2 = make_cycle(5)
     c = join(c5,c5_2)
     g = DalGraph(c)
     c = g.k_color()
     self.assertEqual(c, 6, "KColor: C5 joined with a C5")