jueves, 27 de agosto de 2009

Floyd algorithm

The problem: We have a Graph, no direct and valued, also, we have a vector with N stages. For example, one stage is between nodes 2 and 5, other stage is between nodes 5 and 1 , ect ...
We need the minimun path between first stage and last stage through the middle stages in order.

The solution: We use, Floyd algorithm.

The graph:


The stages :



The output: