(node, visited)
| 57 | } |
| 58 | |
| 59 | dfsKosaraju(node, visited) { |
| 60 | visited.add(node) |
| 61 | this.stronglyConnectedComponents[ |
| 62 | this.stronglyConnectedComponents.length - 1 |
| 63 | ].push(node) |
| 64 | for (const child of this.reverseConnections[node]) { |
| 65 | if (!visited.has(child)) this.dfsKosaraju(child, visited) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | kosaraju() { |
| 70 | // Function to perform Kosaraju Algorithm |