Пример #1
0
    def runTest(self):
        mg = MyGraph(**self.data["no labels"])
        split = mg.digon_split(0, [2])
        t = split.digon_split(3, [1])

        self.assertEqual(len(t.edges()), 6)
        self.assertItemsEqual(mg.vertex_partition(), {0: [1, 2], 1: [3, 4]})
Пример #2
0
 def runTest(self):
     mg = MyGraph(**self.data["from graph"])
     self.assertItemsEqual(mg.vertices(), [1, 2, 3])
     self.assertItemsEqual(mg.edges(), [(1, 2, "e"), (2, 3, "f"),
                                        (3, 1, "g")])
     self.assertItemsEqual(mg.darts, [1, 2, 3, 4, 5, 6])
     self.assertEqual(mg.vertex_partition(), {
         1: [1, 6],
         2: [2, 3],
         3: [4, 5]
     })
Пример #3
0
 def runTest(self):
     g = MyGraph(dart_partitions=[[(1, 2, 3), (4, )], [(1, 2), (3, 4)]])
     self.assertDictEqual(g.vertex_partition(), {0: [1, 2, 3], 1: [4]})