def main(*argv): "GraphAsMatrix test program." print GraphAsMatrix.main.__doc__ g = GraphAsMatrix(32) Graph.test(g) g.purge() Graph.testWeighted(g) return 0
def main(*argv): "GraphAsLists test program." print((GraphAsLists.main.__doc__)) g = GraphAsLists(32) Graph.test(g) g.purge() Graph.testWeighted(g) return 0
def main(*argv): "GraphAsLists test program." print GraphAsLists.main.__doc__ g = GraphAsLists(32) Graph.test(g) g.purge() Graph.testWeighted(g) return 0
def main(*argv): "DigraphAsLists test program." print DigraphAsLists.main.__doc__ dg = DigraphAsLists(32) Graph.test(dg) dg.purge() Graph.testWeighted(dg) return 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)