networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersReturns
_snap_build_graph(G, groups, node_attributes, edge_attributes, neighbor_info, edge_types, prefix, supernode_attribute, superedge_attribute)

Used in the SNAP aggregation algorithm to build the output summary graph and supernode lookup dictionary. This process uses the original graph and the data structures to create the supernodes with the correct node attributes, and the superedges with the correct edge attributes

Parameters

G: networkx.Graph :

the original graph to be summarized

groups: dict :

A dictionary of unique group IDs and their corresponding node groups

node_attributes: iterable :

An iterable of the node attributes considered in the summarization process

edge_attributes: iterable :

An iterable of the edge attributes considered in the summarization process

neighbor_info: dict :

A data structure indicating the number of edges a node has with the groups in the current summarization of each edge type

edge_types: dict :

dictionary of edges in the graph and their corresponding attributes recognized in the summarization

prefix: string :

The prefix to be added to all supernodes

supernode_attribute: str :

The node attribute for recording the supernode groupings of nodes

superedge_attribute: str :

The edge attribute for recording the edge types represented by superedges

Returns

summary graph: Networkx graph

Build the summary graph from the data structures produced in the SNAP aggregation algorithm

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