0

I am working on a project where I have to manipulate graphs. I am using graph-tool library for which I am new and I code using Python 2.7.

I added a new edge property called edge_capacity. For some reason, I need to know to which edge that value belongs to and the vertices that form that edge.

Thank you for pointing me out to a solution.

Regards.

user2567806
  • 460
  • 3
  • 7
  • 17

1 Answers1

1

In general it is useful to know what you have already tried but knowing not much about your actual problem here is one suggestion: the first part could be achieved using find_edge. So if you needed edge_capacity=5 your solution could look like something along these lines:

es = gt.find_edge(g,edge_capacity,5)
for e in es:
    v1 = e.source()
    v2 = e.target()
P-M
  • 1,279
  • 2
  • 21
  • 35