Beispiel #1
0
 def testFindTransitiveClosure(self):
     newGraph = Graph()
     newGraph.addVertex(1)
     newGraph.addVertex(2)
     newGraph.connect(vertexid1=1, vertexid2=2, cost=None)
     testTransitiveClosureSet = newGraph.transitiveClosure(vertexid=1)
     self.assertTrue(1 in testTransitiveClosureSet and
                     2 in testTransitiveClosureSet,
                     'should be inside the transitive closure')
     del newGraph