         var path1Intersections: [Node] = []
         var path2Intersections: [Node] = []
         intersections.forEach {
-            let node1 = Node(location: $0.indexedPathLocation1, pathComponent: path1.components[$0.indexedPathLocation1.componentIndex])
-            let node2 = Node(location: $0.indexedPathLocation2, pathComponent: path2.components[$0.indexedPathLocation2.componentIndex])
+            let node1 = Node(location: $0.indexedPathLocation1, path: path1)
+            let node2 = Node(location: $0.indexedPathLocation2, path: path2)
             node1.addNeighbor(node2)
             node2.addNeighbor(node1)
             path1Intersections.append(node1)

            return temp
        }()
        self.components = (0..<path.components.count).map {
            PathComponentGraph(for: path.components[$0], componentIndex: $0, using: intersectionsByComponent[$0])
        }
    }
}

    var forwardEdge: Edge?
    var backwardEdge: Edge?
    private(set) var neighbors: [Node] = []
    let path: Path
    var pathComponent: PathComponent {
        return path.components[self.location.componentIndex]
    }
    init(location: IndexedPathLocation, path: Path) {
        self.location = location
        self.path = path
    }
    func neighborsContain(_ node: Node) -> Bool {
        return self.neighbors.contains(where: { $0 === node })
