Sunny
Sunny

Reputation:

Change Target of Edge in BGL

If my BGL graph contain edge from node x to node y, and I want to change the target of this edge, so that now it's pointing from x to z, how it can be done?

Are there any functions in BGL for that?

Upvotes: 1

Views: 552

Answers (1)

hvintus
hvintus

Reputation: 2617

You can remove an edge and add another one instead - see remove_edge and add_edge defined in the MutableGraph concept. I don't see any direct manipulation function. Alternatively, you can define your own one that would hide the removal and addition. Special care should be taken for the graphs with properties attached to edges (i.e. MutablePropertyGraph).

Upvotes: 2

Related Questions