You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
named_graph (Gregor, 2007): sound internals (multi-index), but requires trait specialization, tightly coupled to adjacency_list, also undocumented. Friction to adoption due to boilerplate code is high.
Both are incomplete. Users end up maintaining their own std::map<Label, vertex_descriptor> because both options are either broken or too cumbersome.
Proposal
keep labeled_graph external API (simpler one):
add_vertex(label, g)
g.vertex(label)
remove_vertex(label, g)
Replace labeled_graph internal _map with named_graph multi-index machinery. This would eliminate the entire set of map-sync bugs by construction.
Decouple named_graph from adjacency_list so it can back any graph type
Deprecate direct use of named_graph traits (internal_vertex_name, internal_vertex_constructor) as they become implementation details
Problem
Boost.Graph has two overlapping mechanisms for label to vertex lookup:
labeled_graph(Sutton, 2009): simple API, external adaptor, but undocumented, non-compilable example, and broken in multiple ways :named_graph(Gregor, 2007): sound internals (multi-index), but requires trait specialization, tightly coupled toadjacency_list, also undocumented. Friction to adoption due to boilerplate code is high.Both are incomplete. Users end up maintaining their own
std::map<Label, vertex_descriptor>because both options are either broken or too cumbersome.Proposal
labeled_graphexternal API (simpler one):add_vertex(label, g)g.vertex(label)remove_vertex(label, g)labeled_graphinternal_mapwithnamed_graphmulti-index machinery. This would eliminate the entire set of map-sync bugs by construction.named_graphfromadjacency_listso it can back any graph typenamed_graph traits(internal_vertex_name,internal_vertex_constructor) as they become implementation detailsvecSlabel storage that seems fundamentally broken and blocked by static_assert in Fix: labeled_graph pointer specialization remove_vertex not removing label #464)labeled_graph