A
Anna Smith
Hi Folks,
Given a directed graph, is there an algorithm to do the following:
1) Shortest path: the answer is simple. dijkstra algorithm.
2) Given a directed graph, and there is no edge starting and ending at
a node X, can we still used Dijkstra's algorithm to find the shortest
path from X to X.
Here is where I need some help.
1) Give a two nodes, how do we find out the number of paths and the
number of hops between the two paths?
2) Given a sequence of nodes say N1-N5-N3-N4-N2, how do we find out
sum of the weights along the edges. This needs to be done
progamatically.
Any good sites with sample java code or a good java data structures
book?
Thanks,
Anna
Given a directed graph, is there an algorithm to do the following:
1) Shortest path: the answer is simple. dijkstra algorithm.
2) Given a directed graph, and there is no edge starting and ending at
a node X, can we still used Dijkstra's algorithm to find the shortest
path from X to X.
Here is where I need some help.
1) Give a two nodes, how do we find out the number of paths and the
number of hops between the two paths?
2) Given a sequence of nodes say N1-N5-N3-N4-N2, how do we find out
sum of the weights along the edges. This needs to be done
progamatically.
Any good sites with sample java code or a good java data structures
book?
Thanks,
Anna