networkx 2.8.2 Pypi GitHub Homepage
Other Docs
Parameters
_add_edge_to_spanner(H, residual_graph, u, v, weight)

Parameters

H : NetworkX graph

The spanner under construction.

residual_graph : NetworkX graph

The residual graph used by the Baswana-Sen algorithm. The weight for the edge is taken from this graph.

u : node

One endpoint of the edge.

v : node

The other endpoint of the edge.

weight : object

The edge attribute to use as distance.

Add the edge {u, v} to the spanner H and take weight from the residual graph.

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#269
type: <class 'function'>
Commit: