networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
_lightest_meta_edges(mapping, avail_uv, avail_w)

Notes

Each node in the metagraph is a k-edge-connected component in the original graph. We don't care about any edge within the same k-edge-connected component, so we ignore self edges. We also are only intereseted in the minimum weight edge bridging each k-edge-connected component so, we group the edges by meta-edge and take the lightest in each group.

Parameters

mapping : dict

mapping produced by collapse , that maps each node in the original graph to a node in the meta graph

avail_uv : list

list of edges

avail_w : list

list of edge weights

Maps available edges in the original graph to edges in the metagraph.

Examples

>>> # Each group represents a meta-node
... groups = ([1, 2, 3], [4, 5], [6])
... mapping = {n: meta_n for meta_n, ns in enumerate(groups) for n in ns}
... avail_uv = [(1, 2), (3, 6), (1, 4), (5, 2), (6, 1), (2, 6), (3, 1)]
... avail_w = [20, 99, 20, 15, 50, 99, 20]
... sorted(_lightest_meta_edges(mapping, avail_uv, avail_w)) [MetaEdge(meta_uv=(0, 1), uv=(5, 2), w=15), MetaEdge(meta_uv=(0, 2), uv=(6, 1), w=50)]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.connectivity.edge_augmentation._lightest_meta_edges

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/connectivity/edge_augmentation.py#525
type: <class 'function'>
Commit: