boostorg / boostorg/graph

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

Đang mở
#465 0 bình luận 0 reaction 1 người được giao Được @Becheler nhận Xem trên GitHub
data structure
Ngôn ngữ chính
C++
Star
392
Fork
239
Merge trung bình
1 ngày 11 phút
Pull request đã merge (30 ngày)
20

Mô tả

## 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` 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.