public void computePaths(Vertex source)
    {
        counter = 0;
        int Xtemp = 0;
        int Ytemp = 0;
        source.minDistance = 0;
        PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();
        vertexQueue.add(source);

        while (!vertexQueue.isEmpty()) {
            Vertex u = vertexQueue.poll();

            // Visit each edge exiting u
            for (Edge e : u.adjacencies)
            {
                Vertex v = e.target;
                double weight = e.weight;
                double distanceThroughU = u.minDistance + weight;
                //System.out.println(weight + " " + distanceThroughU + " " );
                //System.out.println(v);   
                if (v != null && distanceThroughU < v.minDistance) {
                    vertexQueue.remove(v);

                    Xtemp = v.CoordX;
                    Ytemp = v.CoordY;
                    //System.out.println(Xtemp + ">>>>>>>>>>>>" + Ytemp);
                    house = map.returnLocation(Xtemp, Ytemp);
                    if (house.RoadCheck()){counter++;}

                    v.minDistance = distanceThroughU ;
                    v.previous = u;
                    vertexQueue.add(v);
                }
            }
        }
    }