generate_edgelist(G, delimiter=' ', data=True)
The graph is assumed to have node attribute :None:None:`part`
set to 0,1 representing the two graph parts
Separator for node labels
If False generate no edge data. If True use a dictionary representation of edge data. If a list of keys use a list of data values corresponding to the keys.
Lines of data in adjlist format.
Generate a single line of the bipartite graph G in edge list format.
>>> from networkx.algorithms import bipartite
... G = nx.path_graph(4)
... G.add_nodes_from([0, 2], bipartite=0)
... G.add_nodes_from([1, 3], bipartite=1)
... G[1][2]["weight"] = 3
... G[2][3]["capacity"] = 12
... for line in bipartite.generate_edgelist(G, data=False):
... print(line) 0 1 2 1 2 3
>>> for line in bipartite.generate_edgelist(G):
... print(line) 0 1 {} 2 1 {'weight': 3} 2 3 {'capacity': 12}
>>> for line in bipartite.generate_edgelist(G, data=["weight"]):See :
... print(line) 0 1 2 1 3 2 3
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.bipartite.edgelist.write_edgelist
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