Syntax: rand(Node,graph)
This returns one of the neighbours of a given node, i.e it returns the next node in a walk starting from the given input node..
Eg:
import shortestpath as sp
sp.rand(2,G)
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