         }
         return self.endingNode.pathComponent.split(from: startingNode.componentLocation, to: nextLocation)
     }
+    func visitCoincidentEdges() {
+        let component = self.component
+        let nextEdge = component.element(at: 0)
+        let point = nextEdge.compute(0.5)
+        let normal = nextEdge.normal(0.5)
+        let smallDistance: CGFloat = 1.0e-4
+        let point1 = point + smallDistance * normal
+        let point2 = point - smallDistance * normal
+        func edgeIsCoincident(_ edge: Edge) -> Bool {
+            let rule: PathFillRule = .evenOdd
+            let component = edge.startingNode.pathComponent
+            return component.contains(point1, using: rule) != component.contains(point2, using: rule)
+        }
+        for edge in self.startingNode.neighbors.compactMap({ $0.forwardEdge }) {
+            guard edge.visited == false else { continue }
+            if edge.endingNode.neighborsContain(self.endingNode), edgeIsCoincident(edge) {
+                edge.visited = true
+            }
+        }
+        for edge in self.startingNode.neighbors.compactMap({ $0.backwardEdge }) {
+            guard edge.visited == false else { continue }
+            if edge.startingNode.neighborsContain(self.endingNode), edgeIsCoincident(edge) {
+                edge.visited = true
+            }
+        }
+    }
 }
 
 private class PathComponentGraph {

        let startingLocation = IndexedPathLocation(componentIndex: componentIndex, elementIndex: component.startingIndexedLocation.elementIndex, t: component.startingIndexedLocation.t)
        let endingLocation = IndexedPathLocation(componentIndex: componentIndex, elementIndex: component.endingIndexedLocation.elementIndex, t: component.endingIndexedLocation.t)
        if nodes.first?.location != startingLocation {
            nodes.insert(Node(location: startingLocation, path: path), at: 0)
        }
        if nodes.last?.location != endingLocation {
            nodes.append(Node(location: endingLocation, path: path))
        }
        for i in 1..<nodes.count {
            let startingNode = nodes[i-1]

            let component = edge.component
            appendComponent(forwards ? component : component.reversed())
            edge.visited = true
            edge.visitCoincidentEdges()
            return forwards ? edge.endingNode : edge.startingNode
        }
        func visitNextNode(from node: Node) -> Node? {
