Пример #1
0
        if v.dist != None:
            v.label = v.dist
        else:
            v.label = "inf"


if __name__ == "__main__":
    from time import time

    if UseFastGraphs:
        import fastgraphs
    for FileName in TestInstances:
        if UseFastGraphs:
            print("\n\nLoading graph", FileName, "(Fast graph)")
            # G=loadgraph("graphs/"+FileName,graph)
            G = loadgraph(FileName, fastgraphs.graph)
        else:
            print("\n\nLoading graph", FileName)
            # G=loadgraph("graphs/"+FileName)
            G = loadgraph(FileName)

        for i in range(len(G.V())):
            G[i].colornum = i

        # Tuple arguments below:
        # First: printable string
        # Second: Boolean variable: should test be done?
        # Third: Function
        # Fourth: Filename
        # Fifth: Whether output should be directed
        for testalg in [("Bellman-Ford, undirected", TestBellmanFordUndirected, BellmanFordUndirected,
Пример #2
0
# GL, settings = loadgraph("Basic\\basicGIAut.grl", FastGraph, True)

# graph1 = GL[0]
# graph2 = GL[0]

# graph1 = loadgraph("testGraphs\\threepaths5.gr", FastGraph)
# graph2 = loadgraph("testGraphs\\threepaths160.gr", FastGraph)


# for graph in GL:
#     graph1 = graph
#     graph2 = graph
#     G = disjointunion(graph1, graph2)
#     print(count_isomorphism(G, [], []))

graph1 = loadgraph("Basic\\basicAut2.gr", FastGraph)
graph2 = loadgraph("Basic\\basicAut2.gr", FastGraph)

G = disjointunion(graph1, graph2)

print(count_isomorphism(G, [], []))

# print(isIsomorphism(G))

# graph1 = loadgraph("Basic\\basicGI1.grl", FastGraph, True)[0][1]
# graph2 = loadgraph("Basic\\basicGI1.grl", FastGraph, True)[0][3]

# G = disjointunion(graph1, graph2)