networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
_lightest_edge_dicts(residual_graph, clustering, node)

Searches for the minimum-weight edge to each cluster adjacent to the given node.

Notes

If a cluster has no node that is adjacent to the given node in the residual graph then the center of the cluster is not a key in the returned dictionaries.

Parameters

residual_graph : NetworkX graph

The residual graph used by the Baswana-Sen algorithm.

clustering : dictionary

The current clustering of the nodes.

node : node

The node from which the search originates.

Returns

lightest_edge_neighbor, lightest_edge_weight : dictionary, dictionary

lightest_edge_neighbor is a dictionary that maps a center C to a node v in the corresponding cluster such that the edge from the given node to v is the lightest edge from the given node to any node in cluster. lightest_edge_weight maps a center C to the weight of the aforementioned edge.

Find the lightest edge to each cluster.

Examples

See :

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/sparsifiers.py#223
type: <class 'function'>
Commit: