diff --git a/src/ribasim_nl/ribasim_nl/model.py b/src/ribasim_nl/ribasim_nl/model.py index 5510fea..9c4a739 100644 --- a/src/ribasim_nl/ribasim_nl/model.py +++ b/src/ribasim_nl/ribasim_nl/model.py @@ -754,7 +754,7 @@ def merge_basins( ) if are_connected and (to_node_type != "FlowBoundary"): - paths = [i for i in nx.all_shortest_paths(self.graph, node_id, to_node_id) if len(i) == 3] + paths = [i for i in nx.all_shortest_paths(nx.Graph(self.graph), node_id, to_node_id) if len(i) == 3] if len(paths) == 0: raise ValueError(f"basin {node_id} not a direct neighbor of basin {to_node_id}")