I need help in this prog.
input / output
Please enter starting and ending nodes and a graph:
4 1 5 1 0 1 2 2 2 2 1 3 1
3 2

this is prog to find shortest path using adjacency list. 4 is source 
node 1 is destination node and 5 is size of matrx that is 5*5( 
adjacency matrix) 1 0 2 2 2 2 1 3 1 is matrix list.
we can represent it this (1 0 2 2 2 2 1 3 1) as
01101
00100 
10010
01010
00101

first is one so put zero then put 1 ,next is 1 so no zero put 1,next 
2 put 0 0 then put 1 and so on...
basicaly count no of zero's.

now using this i have to find shortest path 
and answer is 3 2 .where 3 lenght of path and 2 no of short paths.

this represent would work for any input.

i am trying using vector in c++.
i dont know how to do this?
please help me.

Reply via email to