networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersReturns
create_component_structure(G)

A component structure is an :None:None:`nxn` array, denoted c, where n is the number of vertices, where each row and column corresponds to a vertex.

$$c_{uv} = \begin{cases} 0, if v \in N[u] \\ k, if v \in component k of G \setminus N[u] \end{cases}$$

Where :None:None:`k` is an arbitrary label for each component. The structure is used to simplify the detection of asteroidal triples.

Parameters

G : NetworkX Graph

Undirected, simple graph.

Returns

component_structure : dictionary

A dictionary of dictionaries, keyed by pairs of vertices.

Create component structure for G.

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