Click to See Complete Forum and Search --> : Need an algo to find a path bewtween 2 vertices of a digraph


AvDav
November 18th, 2006, 04:55 AM
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.

Yves M
November 18th, 2006, 03:30 PM
Dijkstra's algorithm also gives you the path in a second step. link (http://en.wikipedia.org/wiki/Dijkstra's_algorithm).

AvDav
November 19th, 2006, 04:40 AM
Thank's, Yves, I solved my problem.

ramesh_krnt
November 20th, 2006, 12:30 AM
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

RoboTact
November 21st, 2006, 06:43 AM
Good morning sir, I am working as a lecturer in engg collgege(india). :eek:

Given this definition (http://en.wikipedia.org/wiki/Deterministic_finite_state_machine), and assuming automata with permuted states are equivalent, aswer is <write correct answer here>... ;)