Sunday 3 April 2011

Node distribution function:


syntax: distribution(graph)
    This walks 10000 times randomly in the graph and finds the various intersections of the graphs.. Finally it
    will print the list "c" containing all the intersections and a graph which gives the node numbers on the x axis and the number of walks that have intersected at that node, i.e no. of flags placed in that node on the y axis..

Eg:
Import shortestpath as sp
sp.distribution(G)            //Where G is a graph


This will plot the final graph


You can download the shortestpath module here:



http://www.4shared.com/file/Ysb5ADzo/shortestpath.html




Now paste this file in your home directory if you are using linux, or in your python directory, in windows wherever you have installed python. Details on all the available in-built functions so far in the shortest path module will be followed in subsequent posts.



Note: networkx and matplotlib have to be installed for this to work

No comments:

Post a Comment