Exemplo n.º 1
0
def test_graphs(fn):
    graphs = graph.load_all_graphs(fn)
    for (i,j) in itertools.product(range(len(graphs)), repeat=2):
        iso = graph.isomorphic(graphs[i], graphs[j])
        assert iso == (i == j), "Incorrect result for " + str(i) + "," + str(j)
Exemplo n.º 2
0
def test_iso(n):
    G = nx.gnp_random_graph(n, 0.4)
    Gp = graph.shuffle_graph(G)
    assert graph.isomorphic(G, Gp)