1

A single threaded boost graph that repeatedly removes and then adds same edges later seems to be faster than a multi-threaded filtered_graph that uses edge predicates to concurrently do the same on multiple filtered graphs of the same underlying graph.

Possibly, filtered_graph traverses each and every edge and applies the predicate.

Is there a way to directly generate a filtered_graph without predicates i.e. use functions like remove_edge but actually create a filtered_graph?

Tims
  • 627
  • 7
  • 19

1 Answers1

2

Just use copy_graph on the filtered graph:

sehe
  • 374,641
  • 47
  • 450
  • 633
  • This indeed seems to be faster than using the filtered graph itself. Is it really the case that the filter predicates are re-evaluated each time an edge is accessed? Or what is the reason for this speed difference? – lucidbrot Jan 25 '21 at 08:28
  • 2
    @lucidbrot I'm not sure whether optimizations are in place, but I imagine it would be very hard to get that correctly generically (graph concepts are _very_ generic) so, yeah, it makes a bit of sense. – sehe Jan 25 '21 at 13:02