public static void main(String args[]){
        
        Graph<Integer> graph = new Graph<>(false);
        graph.addEdge(0, 3, 8);
        graph.addEdge(0, 1, 4);
        graph.addEdge(0, 2, 5);
        graph.addEdge(1, 2, -3);
        graph.addEdge(2, 4, 4);
        graph.addEdge(3, 4, 2);
        graph.addEdge(4, 3, 1);

        BellmanFordShortestPath shortestPath = new BellmanFordShortestPath();
        Vertex<Integer> startVertex = graph.getAllVertex().iterator().next();
        Map<Vertex<Integer>,Integer> distance = shortestPath.getShortestPath(graph, startVertex);
        System.out.println(distance);
    }
Date 11/05/2015
@author Tushar Roy

Write program for Bellman Ford algorithm to find single source shortest path in directed graph.
Bellman ford works with negative edges as well unlike Dijksra's algorithm. If there is negative
weight cycle it detects it.

Time complexity - O(EV)
Space complexity - O(V)

References
https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
http://www.geeksforgeeks.org/dynamic-programming-set-23-bellman-ford-algorithm/
src/com/interview/graph/BellmanFordShortestPath.java