Reconcile `labeled_graph` and `named_graph` into a single documented component

Aperta
#465 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Becheler ci sta già lavorando.

Dal 31/3/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

data structure

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 :
    • #147
    • #167
    • #187
  • named_graph (Gregor, 2007): sound internals (multi-index), but requires trait specialization, tightly coupled to adjacency_list, drags in Boost.MultiIndex unconditionally, which drags mp11 ... 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
  • Drop vecS label storage that seems fundamentally broken and blocked by static_assert in #464)
  • Reverse lookup (vertex to label)
  • Eliminate the owning/pointer graph duplication from labeled_graph
  • Write a documentation page + working examples
Lingua principale
C++
Stelle
402
Fork
251
Merge medio
1g 9h
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di boostorg/graph

Tutte le issue di boostorg/graph

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.