Пример #1
0
 def runTest(self):
     g = MyGraph([[0, 1, 0], [0, 2, 1], [0, 3, 2], [1, 2, 3], [1, 3, 4],
                  [2, 3, 5]])
     h = g.edge_deletion(0).edge_deletion(5)
     k = MyGraph(**self.data["4-gon"])
     self.assertEqual(len(h.isomorphisms(k)), 1)
Пример #2
0
 def runTest(self):
     k = MyGraph([[0, 1, 0], [0, 2, 1], [0, 3, 2], [1, 2, 3], [1, 3, 4],
                  [2, 3, 5]])
     self.assertEqual(k.find_divalent_vertex(), None)
     l = k.edge_deletion(0)
     self.assertItemsEqual(l.find_divalent_vertex()[1:], (2, 3))
Пример #3
0
 def runTest(self):
     g = MyGraph(**self.data["digon"])
     h = g.edge_deletion("f")
     self.assertDictEqual(h.edge_partition(), {"e": [1, 3]})