diplomat.utils.graph_opsΒΆ

Contains various optimized graph routines, including counting components, minimum spanning tree, and min cost matching.

Functions

connected_components(graph)

Compute the connected components of a graph.

min_cost_matching(cost_matrix[, mode])

Solve the minimum assignment problem.

min_spanning_tree(graph)

Finds the minimum spanning tree of a graph encoded as an adjacency matrix.

to_valid_graph(g[, diag_fill])

Convert an arbitrary adjacency matrix to a valid undirected graph.