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

オープン
#465 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Becheler がすでに取り組んでいます。

2026年3月31日 から。

評価

この issue はまだ評価されていません。

説明

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
主要言語
C++
スター
402
フォーク
251
平均マージ
1日 9時間
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/graph のほかの issue

boostorg/graph の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。