Revised Bellman-Ford algorithm finding shortest path on extended networks