Result: A tighter “deep‑guard” that’s easier to audit and maintain.
# Example usage graph = Graph.new graph.add_nodes([1, 2, 3, 4, 5]) graph.add_edges([[1, 2], [2, 3], [3, 4], [4, 5], [5, 1]]) glebokiegardlogrubyfiutgrupowanakorytarzu20 better