コード例 #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["digon"])
     split = mg.digon_split("u", [], vertex_labels=("u_1", "u_2"))
     self.assertItemsEqual(split.vertex_partition(), {
         "u_1": [5, 7],
         "u_2": [1, 2, 6, 8],
         "v": [3, 4]
     })