samplomatic.graph_utils

Graph Utilities

Functions

find_unreachable_nodes(graph, start_idxs)

Find all nodes from the graph that are not reachable from the start nodes.

get_clusters(graph, filter_fn)

Yield lists of nodes that all pass the filter and are connected in the graph.

replace_edges_with_one_edge(graph, ...)

Replace all the parallel edges between two nodes with a single edge.

replace_nodes_with_one_node(graph, ...)

Replace given nodes with a single node, preserving all outward/inward edges.

Classes

NodeCandidate(graph, node)

A node that we want to add to the graph, but not yet.