Statistics
| Branch: | Revision:

nepatest_popbabel / scripts / allpath.py @ 60ba786f

History | View | Annotate | Download (415 Bytes)

1
import sys
2
import networkx as nx
3
import code
4

    
5
graphfile = sys.argv[1]
6

    
7
g = nx.read_weighted_edgelist(graphfile)
8

    
9
allpath = {}
10
for s in g.nodes():
11
    for d in g.nodes():
12
        if (g!=d):
13
            allpath[(s,d)]=list(nx.all_shortest_paths(g,s,d))
14

    
15
for k in allpath:
16
    s,d=k[0],k[1]
17
    if len(allpath[k])!=1:
18
        code.interact(local=dict(globals(), **locals()))
19
        print s,d
20
        print allpath[k]