4.2: fixing the whole path collision detections in the graph building