Distance between two nodes in weighted directed graph
algorithm, graph, shortest-path
Solution
If A is an algorithm to find shortest path from one vertex to another, and B is an algorithm to find shortest paths between a vertex and all other nodes, it is a proven fact that optimal complexity of A is not better than optimal complexity of B. I.e. you cannot compute path to a single vertex, you have to also compute paths to all other nodes. In simple words, how can you be sure you found the shortest path if you don't even know paths to other nodes?
However, even though there exist no algorithm A with complexity better that algorithm B, a particular implementation of A might be made more optimized than implementation of B, up to a constant factor. In your case of positive edges, you can halt Dijkstra algorithm when the destination vertex is relaxed. But you might still have to process all the vertices in the worst case.
This optimization wouldn't be possible in case you have negative edges, but Dijkstra algorithm cannot handle this case either. You would need Bellman–Ford algorithm for this case.
Floyd-Warshall is overkill here, you obviously don't need paths from all vertices to all others. So Dijkstra is the way to go, I think. If you are looking for the optimal complexity, you can use the heap-based implementation, or even Fibonacci heaps. Complexities for all cases are given in wiki page for Dijkstra algorithm. It is also stated that:
This [Dijkstra with Fibonacci heaps] is asymptotically the fastest known single-source shortest-path algorithm for arbitrary directed graphs with unbounded non-negative weights.
So you shouldn't bother to find any asymptotically better algorithm.
Problem
which algorithm is most optimized for searching the shortest distance between two nodes in positive weighted directed graph? I know that dijkstra is an option but it calculates from src to all nodes. Same as Floyd-Warshall. One additional issue. I would need a distance for a node that is source and destination. For example: src - F, dest - F I need it to calculate 2.45 in this example, not 0 as would dijkstra get. Can I modify dijkstra? I've implemented this one http://www.vogella.com/tutorials/JavaAlgorithmsDijkstra/article.html (source: numb3rs at www.math.cornell.edu)