networkx 2.8.2 Pypi GitHub Homepage
Other Docs
_generate_graph6_bytes(G, nodes, header)

:None:None:`G` is an undirected simple graph. nodes is the list of nodes for which the node-induced subgraph will be encoded; if nodes is the list of all nodes in the graph, the entire graph will be encoded. :None:None:`header` is a Boolean that specifies whether to generate the header b'>>graph6<<' before the remaining data.

This function generates :None:None:`bytes` objects in the following order:

  1. the header (if requested),

  2. the encoding of the number of nodes,

  3. each character, one-at-a-time, in the encoding of the requested node-induced subgraph,

  4. a newline character.

This function raises ValueError if the graph is too large for the graph6 format (that is, greater than 2 ** 36 nodes).

Yield bytes in the graph6 encoding of a 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/readwrite/graph6.py#22
type: <class 'function'>
Commit: