find all paths in an undirected graph.

A forum for general discussion of the Python programming language.

find all paths in an undirected graph.

Postby saifjunaid » Tue Jun 11, 2013 5:32 am

hi i want the algorithm to find all possible paths from source node to destination node in an undirected graph such that a path may traverse the link only once.i was able to implemented it for a directed graph but i dont know how to implemented in undirected graph.please help me.

b
/ | \
/ | \
a---+---d
\ | /
\ | /
c

If the source is 'a', and the destination is 'd', the program should return:

a - d
a - b - d
a - c - d
a - b - c - d
a - c - b - d
the input should be taken from the user for nodes.Thanks in advance
saifjunaid
 
Posts: 8
Joined: Sat Feb 23, 2013 10:53 am

Re: find all paths in an undirected graph.

Postby micseydel » Tue Jun 11, 2013 6:41 am

Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 1132
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Discussions

Who is online

Users browsing this forum: metulburr and 4 guests