public int compare(Integer node1,Integer node2){
  double dist1=distancesFromStart.get(node1);
  double dist2=distancesFromStart.get(node2);
  if (dist1 > dist2) {
    return 1;
  }
 else   if (dist1 < dist2) {
    return -1;
  }
 else {
    return node1.compareTo(node2);
  }
}

public int compare ( Integer node1 , Integer node2 ) { double dist1 = distancesFromStart . get ( node1 ) ; double dist2 = distancesFromStart . get ( node2 ) ; if ( dist1 > dist2 ) { return 1 ; } else if ( dist1 < dist2 ) { return - 1 ; } else { return node1 . compareTo ( node2 ) ; } }
compares two map nodes by their distance from the source node
