NetworkX

Previous topic

networkx.LabeledGraph.edges_iter

Next topic

networkx.LabeledGraph.neighbors

Quick search

networkx.LabeledGraph.get_edge

LabeledGraph.get_edge(u, v, default=None)

Return the data associated with the edge (u,v).

Parameters:

u,v : nodes

If u or v are not nodes in graph an exception is raised.

default: any Python object :

Value to return if the edge (u,v) is not found. If not specified, raise an exception.

Notes

It is faster to use G[u][v].

>>> G[0][1]
1

Examples

>>> G=nx.path_graph(4) # path graph with edge data all set to 1
>>> G.get_edge(0,1) 
1
>>> e=(0,1)
>>> G.get_edge(*e) # tuple form
1