示例#1
0
 def main(*argv):
     "GraphAsMatrix test program."
     print GraphAsMatrix.main.__doc__
     g = GraphAsMatrix(32)
     Graph.test(g)
     g.purge()
     Graph.testWeighted(g)
     return 0
示例#2
0
 def main(*argv):
     "GraphAsLists test program."
     print((GraphAsLists.main.__doc__))
     g = GraphAsLists(32)
     Graph.test(g)
     g.purge()
     Graph.testWeighted(g)
     return 0
示例#3
0
 def main(*argv):
     "GraphAsLists test program."
     print GraphAsLists.main.__doc__
     g = GraphAsLists(32)
     Graph.test(g)
     g.purge()
     Graph.testWeighted(g)
     return 0
示例#4
0
 def main(*argv):
     "DigraphAsLists test program."
     print DigraphAsLists.main.__doc__
     dg = DigraphAsLists(32)
     Graph.test(dg)
     dg.purge()
     Graph.testWeighted(dg)
     return 0
示例#5
0
 def main(*argv):
     "GraphAsMatrix test program."
     print GraphAsMatrix.main.__doc__
     g = GraphAsMatrix(32)
     Graph.test(g)
     g.purge()
     Graph.testWeighted(g)
     return 0
示例#6
0
 def main(*argv):
     "DigraphAsLists test program."
     print DigraphAsLists.main.__doc__
     dg = DigraphAsLists(32)
     Graph.test(dg)
     dg.purge()
     Graph.testWeighted(dg)
     return 0
示例#7
0
文件: digraph.py 项目: RDWang/python
 def test(g):
     "Digraph test program."
     print Digraph.test.__doc__
     Graph.test(g)
     visitor = PrintingVisitor()
     print "TopologicalOrderTraversal"
     g.topologicalOrderTraversal(visitor)
     visitor.finish()
     print "isCyclic returns " + str(g.isCyclic)
     print "isStronglyConnected returns " + str(g.isStronglyConnected)
示例#8
0
 def test(g):
     "Digraph test program."
     print Digraph.test.__doc__
     Graph.test(g)
     visitor = PrintingVisitor()
     print "TopologicalOrderTraversal"
     g.topologicalOrderTraversal(visitor)
     visitor.finish()
     print "isCyclic returns " + str(g.isCyclic)
     print "isStronglyConnected returns " + str(g.isStronglyConnected)