Sunday 3 April 2011

Random walk function added:

Syntax: walk(graph,source,destination)
    This returns a list of nodes which constitute a random walk 
    between the source and destination nodes in which the graph is traversed
    from the one node in the list to the next node respectively

Eg:
import shortestpath as sp
sp.walk(G,2,7)         //Where G is the graph name, 2 and 7 are                                                                  .                     // The source and the destination nodes 



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.

No comments:

Post a Comment