igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] python-igraph: Get graph from edge


From: Bradford Boyle
Subject: [igraph] python-igraph: Get graph from edge
Date: Wed, 19 Jun 2013 16:23:34 -0400

Using python-igraph, is it possible to, given an edge, get the graph that the edge is contained in? Suppose that I have a graph G, executing `print(g.__repr__())` returns:

    <igraph.Graph object at 0x7ff56ecbf810>

whereas `print(g.es[0].__repr__())` returns:

    <igraph.Edge(<igraph.Graph object at 0x7ff56ecbf810>, 0, {})>

This would suggest to me that internally, igraph is keeping track of which graph object an edge belongs to. The motivation for my question is that given only an edge, I cannot get attributes from the source or target vertices. To access the vertex attributes, I would need both the graph and the edge. If the graph could be gotten from the edge, then edge be sufficient.

Bradford

reply via email to

[Prev in Thread] Current Thread [Next in Thread]