replace_nodes_with_one_node
samplomatic.graph_utils.replace_nodes_with_one_node(graph: PyDiGraph[T, S], node_idxs: Iterable[int], new_node: T) → int
Replace given nodes with a single node, preserving all outward/inward edges.
Parameters
- graph – The graph to mutate.
- node_idxs – The connected nodes to replace.
- new_node – The node to replace them with.
Returns
The index of the new node in the graph.
このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。