public <T> void shortestPaths(DestSrcSampleGraph graph, Integer source, boolean untilReachDest) {
    	this.source = source;
        /* Create a Fibonacci heap storing the distances of unvisited nodes
         * from the source node.
         */
        FibonacciHeap<Integer> pq = new FibonacciHeap<Integer>();

        /* The Fibonacci heap uses an internal representation that hands back
         * Entry objects for every stored element.  This map associates each
         * node in the graph with its corresponding Entry.
         */
        Map<Integer, FibonacciHeap.Entry<Integer>> entries = new HashMap<Integer, FibonacciHeap.Entry<Integer>>();

        /* Maintain a map from nodes to their distances.  Whenever we expand a
         * node for the first time, we'll put it in here.
         */
        result = new HashMap<Integer, Double>();
        resultsParent = new HashMap<Integer, Integer>();
        /* Add each node to the Fibonacci heap at distance +infinity since
         * initially all nodes are unreachable.
         */
        for (int i = 0; i < graph.proteinsCount+1; i++)
            entries.put(i, pq.enqueue(i, Double.POSITIVE_INFINITY));

        /* Update the source so that it's at distance 0.0 from itself; after
         * all, we can get there with a path of length zero!
         */
        pq.decreaseKey(entries.get(source), 0.0);
        

        /* Keep processing the queue until no nodes remain. */
        while (!pq.isEmpty()) {
            /* Grab the current node.  The algorithm guarantees that we now
             * have the shortest distance to it.
             */
            FibonacciHeap.Entry<Integer> curr = pq.dequeueMin();

            /* Store this in the result table. */
            result.put(curr.getValue(), curr.getPriority());
            
            if(untilReachDest)
            {
	            for(int i = 0; i < graph.dests.length; i++)
	            	if(curr.getValue() == graph.dests[i])
	            	{
	            		dest = curr.getValue();
	            		return;
	            	}
            }
            

            /* Update the priorities of all of its edges. */
            for (Map.Entry<Integer, Double> arc : graph.edgesFrom((Integer)curr.getValue()).entrySet()) {
                /* If we already know the shortest path from the source to
                 * this node, don't add the edge.
                 */
            	
            	
                if (result.containsKey(arc.getKey())) continue;

                /* Compute the cost of the path from the source to this node,
                 * which is the cost of this node plus the cost of this edge.
                 */
                double pathCost = curr.getPriority() + arc.getValue();

                /* If the length of the best-known path from the source to
                 * this node is longer than this potential path cost, update
                 * the cost of the shortest path.
                 */
                
                FibonacciHeap.Entry<Integer> dest = entries.get(arc.getKey());
                if (pathCost < dest.getPriority())
                {
                    pq.decreaseKey(dest, pathCost);
                    resultsParent.put(dest.getValue(), curr.getValue());
                }
            }
        }

        /* Finally, report the distances we've found. */

    }