public void drawShortestPath(Graphics g)
    {
        TreeMap<Vertex, Vertex> previousPoint = 
                Dijkstra.getShortestPaths(vertices.endA, vertices.endB, vertices.getVertices().toLinkedList());
        if (previousPoint == null)  return;
        
        TreeMap<Vertex, Vertex> shortestPath = new TreeMap(new VertexComparator());
        Vertex next = vertices.endB;
        while (next != null)
        {
            Vertex q = previousPoint.get(next);
            if (q != null)
                drawEdge(g, Color.blue, q, next);
            shortestPath.put(next, q);
            next = q;
        }
        
        while (!previousPoint.isEmpty())
        {
            Vertex p = (Vertex)previousPoint.getMin();
            if (p != null)
            {
                Vertex q = previousPoint.get(p);
                if (q != shortestPath.get(p))
                    drawEdge(g, Color.LIGHT_GRAY, p, q);
                previousPoint.remove(p);
            }
        }
    }