Bellman-Ford algorithm for single source shortest path problem in graphics.