Check if a node has a self-loop.
(self, node_id: str, nodes: Dict[str, Node])
| 88 | return self.cycles |
| 89 | |
| 90 | def _has_self_loop(self, node_id: str, nodes: Dict[str, Node]) -> bool: |
| 91 | """Check if a node has a self-loop.""" |
| 92 | node = nodes.get(node_id) |
| 93 | if not node: |
| 94 | return False |
| 95 | return any(edge_link.target.id == node_id for edge_link in node.iter_outgoing_edges()) |
| 96 | |
| 97 | def _strong_connect(self, node_id: str, nodes: Dict[str, Node]) -> None: |
| 98 | """Recursive part of Tarjan's algorithm.""" |
no test coverage detected