public void reinit() {
    if(distance != Double.POSITIVE_INFINITY) {
        distance = Double.POSITIVE_INFINITY;

        for(int i=0; i<neighbors.length; i++)
            neighbors[i].reinit();
    }
}


public void findPathTo(Location to) {
    LocationSet set = new LocationSet();
    Location cur = this;

    distance = 0;
    while(cur != null && cur != to) {
        cur.proceedNode(set);
        cur = set.removeMin();
    }

    if(cur == null)
        System.out.println("Unable to find a path from " + name + " to " + to.name);
    else {
        System.out.println("Your trip from " + name + " to " + to.name + " in reverse order");
        for(cur=to; cur!=this; cur=cur.from) {
            System.out.println("  " + cur.name + " at " + cur.distance);
        }
    }
    reinit();
}