|
-
November 18th, 2006, 04:55 AM
#1
Need an algo to find a path bewtween 2 vertices of a digraph
Hi guys, is there any standard algorithm to find any path bewtween any 2 vertices of a digraph? The graph is represented by ajdacency matrix and I need such an algorithm by which I can get the set of vertices (actrually the path) which are on the way from starting vertex to ending vertex.
I looked for Dijktsra's shortest path but all those version are outputing the min cost of the path, I need a sequence of vertices of the path, in other words there is a path between i-th and j-th vertex, I need this: [i, a1, a2, ..., ai, ..., j]. Also I looked for Depth First Search but this gave just a bool value if such path exiost whenever I need all vertices of the path. Also it is known that there is only 1 path bewtween any 2 vertices.
Waiting for your inputs.
Best Regards, David.
-
November 18th, 2006, 03:30 PM
#2
Re: Need an algo to find a path bewtween 2 vertices of a digraph
Dijkstra's algorithm also gives you the path in a second step. link.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
November 19th, 2006, 04:40 AM
#3
Re: Need an algo to find a path bewtween 2 vertices of a digraph
Thank's, Yves, I solved my problem.
-
November 20th, 2006, 12:30 AM
#4
Re: problem on Theory of computation
Good morning sir, I am working as a lecturer in engg collgege(india). i have one doubt on the following question in Theory of computation.
How many possible number of DFA's exist 2states over alphabet{0,1}.
a) 16 b) 14 c) 20 d) 24
give clear explanation. if there is any formulae plz mail to me....
Thanking u sir.
Ramesh Karnati
Last edited by ramesh_krnt; November 20th, 2006 at 12:34 AM.
Reason: changing title
-
November 21st, 2006, 06:43 AM
#5
Re: problem on Theory of computation
 Originally Posted by ramesh_krnt
Good morning sir, I am working as a lecturer in engg collgege(india).
Given this definition, and assuming automata with permuted states are equivalent, aswer is <write correct answer here>...
"Programs must be written for people to read, and only incidentally for machines to execute."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|