public static void main(String args[]){
        Graph<Integer> graph = new Graph<Integer>(true);
        graph.addEdge(1, 2,4);
        graph.addEdge(2, 3,3);
        graph.addEdge(2, 4,2);
        graph.addEdge(1, 3,2);
        graph.addEdge(3, 5,1);
        graph.addEdge(4, 5,5);
        graph.addEdge(5, 6,2);
        graph.addEdge(4, 7,3);

        DAGShortestPathTopological<Integer> shortestPath = new DAGShortestPathTopological<Integer>();
        Map<Vertex<Integer>,Integer> distance = shortestPath.shortestPath(graph, graph.getAllVertex().iterator().next());
        System.out.print(distance);
        
    }
http://www.geeksforgeeks.org/shortest-path-for-directed-acyclic-graphs/
src/com/interview/graph/DAGShortestPathTopological.java