Skip to content
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<table><tr>
<td><img src="docs/assets/logo.svg" width="120" alt="graph-v3 logo"></td>
<td>

# graph-v3

**A modern C++20 graph library — header-only, descriptor-based, works with your containers.**

</td>
</tr></table>

<!-- Canonical counts from docs/status/metrics.md — update there first. -->

[![C++ Standard](https://img.shields.io/badge/C%2B%2B-20-blue.svg)](https://en.cppreference.com/w/cpp/20)
Expand All @@ -17,7 +24,7 @@
- **13 algorithms** — Dijkstra, Bellman-Ford, BFS, DFS, topological sort, connected components, articulation points, biconnected components, MST, triangle counting, MIS, label propagation, Jaccard coefficient
- **7 lazy views** — vertexlist, edgelist, incidence, neighbors, BFS, DFS, topological sort — all composable with range adaptors
- **Customization Point Objects (CPOs)** — adapt existing data structures without modifying them
- **3 containers, 26 trait combinations** — `dynamic_graph`, `compressed_graph`, `undirected_adjacency_list` with mix-and-match vertex/edge storage
- **3 containers, 27 trait combinations** — `dynamic_graph`, `compressed_graph`, `undirected_adjacency_list` with mix-and-match vertex/edge storage
- **4261 tests passing** — comprehensive Catch2 test suite

---
Expand Down Expand Up @@ -78,7 +85,7 @@ Both share a common descriptor system and customization-point interface.
|----------|-----------------|---------|
| **Algorithms** | Dijkstra, Bellman-Ford, BFS, DFS, topological sort, connected components, articulation points, biconnected components, MST, triangle counting, MIS, label propagation, Jaccard | [Algorithm reference](docs/status/implementation_matrix.md#algorithms) |
| **Views** | vertexlist, edgelist, incidence, neighbors, BFS, DFS, topological sort | [View reference](docs/status/implementation_matrix.md#views) |
| **Containers** | `dynamic_graph` (26 trait combos), `compressed_graph` (CSR), `undirected_adjacency_list` | [Container reference](docs/status/implementation_matrix.md#containers) |
| **Containers** | `dynamic_graph` (27 trait combos), `compressed_graph` (CSR), `undirected_adjacency_list` | [Container reference](docs/status/implementation_matrix.md#containers) |
| **CPOs** | 19 customization point objects (vertices, edges, target_id, vertex_value, edge_value, …) | [CPO reference](docs/reference/cpo-reference.md) |
| **Concepts** | 9 graph concepts (edge, vertex, adjacency_list, …) | [Concepts reference](docs/reference/concepts.md) |

Expand Down Expand Up @@ -174,4 +181,4 @@ Distributed under the [Boost Software License 1.0](LICENSE).
---

<!-- Status counts pinned to docs/status/metrics.md -->
**Status:** 4261 / 4261 tests passing · 13 algorithms · 7 views · 3 containers · 26 trait combinations · C++20 · BSL-1.0
**Status:** 4261 / 4261 tests passing · 13 algorithms · 7 views · 3 containers · 27 trait combinations · C++20 · BSL-1.0
46 changes: 23 additions & 23 deletions agents/archive/dynamic_graph_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
- ✅ uous (unordered_map + unordered_set): Basic + CPO tests COMPLETE (53 test cases, 563 assertions)

**Phase 4.3: Map-Based Edge Containers - COMPLETE ✅**
- ✅ voem (vector + map edges): Basic + CPO tests COMPLETE (46 test cases, 292 assertions)
- ✅ moem (map + map edges): Basic + CPO tests COMPLETE (53 test cases, 578 assertions)
- ✅ vom (vector + map edges): Basic + CPO tests COMPLETE (46 test cases, 292 assertions)
- ✅ mom (map + map edges): Basic + CPO tests COMPLETE (53 test cases, 578 assertions)

**Phase 4 Overall: 100% COMPLETE ✅ (10/10 traits implemented)**

Expand Down Expand Up @@ -102,8 +102,8 @@
- test_dynamic_graph_uous.cpp + test_dynamic_graph_cpo_uous.cpp ✅

*Map Edge Containers (4 files):*
- test_dynamic_graph_voem.cpp + test_dynamic_graph_cpo_voem.cpp ✅
- test_dynamic_graph_moem.cpp + test_dynamic_graph_cpo_moem.cpp ✅
- test_dynamic_graph_vom.cpp + test_dynamic_graph_cpo_vom.cpp ✅
- test_dynamic_graph_mom.cpp + test_dynamic_graph_cpo_mom.cpp ✅

*Additional Test Files:*
- test_dynamic_graph_common.cpp ✅
Expand Down Expand Up @@ -965,42 +965,42 @@ All prerequisites for both std::set (Phase 4.1) and std::unordered_set (Phase 4.
| 4.3.1b | Identify changes needed for map-based edge access (key vs iterator) | ✅ DONE |
| 4.3.1c | Design edge_descriptor changes for map-based edges (if any) | ✅ DONE |

**Step 4.3.2: Create voem_graph_traits (vector + edge map)** ✅ **COMPLETE** (2024-12-28)
**Step 4.3.2: Create vom_graph_traits (vector + edge map)** ✅ **COMPLETE** (2024-12-28)

**Implementation Summary:**
- Added is_map_based_edge_container concept to container_utility.hpp
- Added emplace_edge helper for pair-wrapped edge insertion
- Updated edge_descriptor::target_id() to unwrap map pairs
- Updated edge_value CPO to extract values from map pairs
- Created voem_graph_traits.hpp with std::map<VId, edge_type> edges
- Created test_dynamic_graph_voem.cpp (~741 lines, 25 test cases)
- Created test_dynamic_graph_cpo_voem.cpp (~1273 lines, 21 test cases)
- Created vom_graph_traits.hpp with std::map<VId, edge_type> edges
- Created test_dynamic_graph_vom.cpp (~741 lines, 25 test cases)
- Created test_dynamic_graph_cpo_vom.cpp (~1273 lines, 21 test cases)
- All 46 test cases passing

| Step | Task | Status |
|------|------|--------|
| 4.3.2a | Create voem_graph_traits.hpp | ✅ DONE |
| 4.3.2a | Create vom_graph_traits.hpp | ✅ DONE |
| 4.3.2b | Update load_edges or edge insertion for map semantics | ✅ DONE |
| 4.3.2c | Create test_dynamic_graph_voem.cpp basic tests (~800 lines) | ✅ DONE |
| 4.3.2d | Create test_dynamic_graph_cpo_voem.cpp CPO tests (~1200 lines) | ✅ DONE |
| 4.3.2c | Create test_dynamic_graph_vom.cpp basic tests (~800 lines) | ✅ DONE |
| 4.3.2d | Create test_dynamic_graph_cpo_vom.cpp CPO tests (~1200 lines) | ✅ DONE |
| 4.3.2e | Update CMakeLists.txt and verify tests pass | ✅ DONE |

**Step 4.3.3: Create moem_graph_traits (map vertices + edge map)** ✅ **COMPLETE** (2024-12-28)
**Step 4.3.3: Create mom_graph_traits (map vertices + edge map)** ✅ **COMPLETE** (2024-12-28)

**Implementation Summary:**
- Created moem_graph_traits.hpp with std::map vertices and std::map edges
- Created mom_graph_traits.hpp with std::map vertices and std::map edges
- Simplified operator[] using at() for both container types (throws if not found)
- Added is_map_based_vertex_container concept
- Tests derived from mos (which also has map vertices)
- Created test_dynamic_graph_moem.cpp (~1123 lines, 27 test cases)
- Created test_dynamic_graph_cpo_moem.cpp (~1274 lines, 26 test cases)
- Created test_dynamic_graph_mom.cpp (~1123 lines, 27 test cases)
- Created test_dynamic_graph_cpo_mom.cpp (~1274 lines, 26 test cases)
- All 53 test cases passing

| Step | Task | Status |
|------|------|--------|
| 4.3.3a | Create moem_graph_traits.hpp | ✅ DONE |
| 4.3.3b | Create test_dynamic_graph_moem.cpp (~800 lines) | ✅ DONE |
| 4.3.3c | Create test_dynamic_graph_cpo_moem.cpp (~1200 lines) | ✅ DONE |
| 4.3.3a | Create mom_graph_traits.hpp | ✅ DONE |
| 4.3.3b | Create test_dynamic_graph_mom.cpp (~800 lines) | ✅ DONE |
| 4.3.3c | Create test_dynamic_graph_cpo_mom.cpp (~1200 lines) | ✅ DONE |
| 4.3.3d | Update CMakeLists.txt and verify tests pass | ✅ DONE |

---
Expand All @@ -1010,7 +1010,7 @@ All prerequisites for both std::set (Phase 4.1) and std::unordered_set (Phase 4.
**Total New Traits:**
- Set edges: vos, dos, mos, uos (4 traits)
- Unordered set edges: vous, dous, mous, uous (4 traits)
- Map edges: voem, moem (2 traits)
- Map edges: vom, mom (2 traits)

**Implementation Changes:**
- operator<=> for dynamic_edge (generates <, >, <=, >=)
Expand Down Expand Up @@ -1038,8 +1038,8 @@ that map/unordered_map-based vertex containers work correctly with various ID ty
the standard integral types.

**Current State Analysis:**
- Map-based containers (mos, moem, mol, etc.) already support `std::string` vertex IDs
- Tests exist with `std::string` IDs in: mos, mous, moem, mol, mov, mod, mofl tests
- Map-based containers (mos, mom, mol, etc.) already support `std::string` vertex IDs
- Tests exist with `std::string` IDs in: mos, mous, mom, mol, mov, mod, mofl tests
- Basic string ID functionality is validated but not comprehensively tested
- No tests exist for: double IDs, compound types, custom types with complex comparison

Expand Down Expand Up @@ -1088,7 +1088,7 @@ the standard integral types.
|-------|-------------|-----------|-----------------|
| mos | 3 test cases | 22 sections | ✅ Comprehensive |
| mous | 3 test cases | 22 sections | ✅ Comprehensive |
| moem | 3 test cases | 22 sections | ✅ Comprehensive |
| mom | 3 test cases | 22 sections | ✅ Comprehensive |
| mol | 3 test cases | ~20 sections | ✅ Comprehensive |
| mov | 3 test cases | ~20 sections | ✅ Comprehensive |
| mod | 3 test cases | ~20 sections | ✅ Comprehensive |
Expand Down Expand Up @@ -2080,7 +2080,7 @@ For Phase 5 (non-integral):
1. **Finish Phase 4.1.4** - Complete mos CPO tests (1-2 days)
2. **Phase 4.1.5** - uos (unordered_map + set) basic + CPO tests (2-3 days)
3. **Phase 4.2** - Unordered set edge containers (vous, dous, mous, uous) (4-5 days)
4. **Phase 4.3** - Map-based edge containers (voem, moem) (3-4 days)
4. **Phase 4.3** - Map-based edge containers (vom, mom) (3-4 days)
5. **Phase 7.3** - Edge cases (ongoing, 2-3 days)
6. **Phase 6** - Integration tests (2-3 days)
7. **Phase 7.1** - Mutation operations (2-3 days)
Expand Down
16 changes: 8 additions & 8 deletions agents/archive/test_reorganization_execution_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ git mv tests/test_dynamic_graph_uol.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_uov.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_uod.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_vos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_voem.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_moem.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_vom.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_mom.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_dos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_mos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_uos.cpp tests/container/dynamic_graph/
Expand Down Expand Up @@ -190,8 +190,8 @@ git mv tests/test_dynamic_graph_cpo_uol.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_uov.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_uod.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_vos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_voem.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_moem.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_vom.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_mom.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_dos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_mos.cpp tests/container/dynamic_graph/
git mv tests/test_dynamic_graph_cpo_uos.cpp tests/container/dynamic_graph/
Expand Down Expand Up @@ -309,8 +309,8 @@ add_executable(graph3_container_tests
dynamic_graph/test_dynamic_graph_uov.cpp
dynamic_graph/test_dynamic_graph_uod.cpp
dynamic_graph/test_dynamic_graph_vos.cpp
dynamic_graph/test_dynamic_graph_voem.cpp
dynamic_graph/test_dynamic_graph_moem.cpp
dynamic_graph/test_dynamic_graph_vom.cpp
dynamic_graph/test_dynamic_graph_mom.cpp
dynamic_graph/test_dynamic_graph_dos.cpp
dynamic_graph/test_dynamic_graph_mos.cpp
dynamic_graph/test_dynamic_graph_uos.cpp
Expand Down Expand Up @@ -350,8 +350,8 @@ add_executable(graph3_container_tests
dynamic_graph/test_dynamic_graph_cpo_uov.cpp
dynamic_graph/test_dynamic_graph_cpo_uod.cpp
dynamic_graph/test_dynamic_graph_cpo_vos.cpp
dynamic_graph/test_dynamic_graph_cpo_voem.cpp
dynamic_graph/test_dynamic_graph_cpo_moem.cpp
dynamic_graph/test_dynamic_graph_cpo_vom.cpp
dynamic_graph/test_dynamic_graph_cpo_mom.cpp
dynamic_graph/test_dynamic_graph_cpo_dos.cpp
dynamic_graph/test_dynamic_graph_cpo_mos.cpp
dynamic_graph/test_dynamic_graph_cpo_uos.cpp
Expand Down
2 changes: 1 addition & 1 deletion agents/archive/view_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ Created `tests/views/test_edgelist.cpp`:
- Value function receives descriptor
- Structured bindings work: `for (auto [e] : edgelist(g))` and `for (auto [e, val] : edgelist(g, evf))`
- Tests pass with sanitizers
- Map-based containers supported (vov, voem, mov, moem)
- Map-based containers supported (vov, vom, mov, mom)

**Commit Message**:
```
Expand Down
4 changes: 2 additions & 2 deletions agents/archive/view_strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,11 @@ with both index-based and iterator-based vertex/edge storage:

**Edge Container Types**:
- `vector<edge>` - Random-access edges
- `map<VId, EV>` (voem, moem, etc.) - Sorted edges by target, deduplicated
- `map<VId, EV>` (vom, mom, etc.) - Sorted edges by target, deduplicated
- `list<edge>` - Forward-only edges

**Test Matrix** (minimum coverage per view):
| View | vov | mov | voem | moem |
| View | vov | mov | vom | mom |
|------|-----|-----|------|------|
| vertexlist | ✓ | ✓ | ✓ | ✓ |
| incidence | ✓ | ✓ | ✓ | ✓ |
Expand Down
4 changes: 2 additions & 2 deletions agents/bgl2_comparison_result.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ using G = dynamic_graph<double, std::string, void, uint32_t, false,

| Vertices | Edges | Trait |
|----------|-------|-------|
| vector | vector, list, forward_list, deque, set, unordered_set, edge_multimap | vov, vol, vofl, vod, vos, vous, voem |
| vector | vector, list, forward_list, deque, set, unordered_set, edge_multimap | vov, vol, vofl, vod, vos, vous, vom |
| deque | vector, list, forward_list, deque, set, unordered_set | dov, dol, dofl, dod, dos, dous |
| map | vector, list, forward_list, deque, set, unordered_set, edge_multimap | mov, mol, mofl, mod, mos, mous, moem |
| map | vector, list, forward_list, deque, set, unordered_set, edge_multimap | mov, mol, mofl, mod, mos, mous, mom |
| unordered_map | vector, list, forward_list, deque, unordered_set | uov, uol, uofl, uod, uous |

#### Level 4: compressed_graph (CSR Format)
Expand Down
10 changes: 5 additions & 5 deletions agents/doc_refactor_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ The current header includes 6 non-existent paths. The mapping from broken → re
# View count (exclude infrastructure: view_concepts, adaptors, basic_views, search_base)
echo "7 views (vertexlist, edgelist, incidence, neighbors, bfs, dfs, topological_sort)"
# Container count
echo "3 containers + 26 trait combinations"
echo "3 containers + 27 trait combinations"
```
- **Pass condition:** Numbers recorded; will be used in status artifact (0.6.1).

Expand Down Expand Up @@ -431,7 +431,7 @@ The current header includes 6 non-existent paths. The mapping from broken → re
1. Title + tagline
2. Shields.io badges (C++20, BSL-1.0, test count from metrics.md, build status placeholder)
3. Highlights (7 bullets — header-only, works with your containers, 13 algorithms,
7 lazy views, CPOs, 3 containers + 26 combinations, test count)
7 lazy views, CPOs, 3 containers + 27 combinations, test count)
4. Quick example (Dijkstra on vector-of-vectors — extract & modernize from current README
or `examples/dijkstra_clrs_example.cpp`)
5. Two ADTs: brief equal-weight description of adjacency lists and edge lists
Expand Down Expand Up @@ -591,15 +591,15 @@ The current header includes 6 non-existent paths. The mapping from broken → re
- `include/graph/container/undirected_adjacency_list.hpp` — dual-linked construction using intrusive lists
- `include/graph/container/container_utility.hpp` — shared utilities
- `/mnt/d/dev_graph/P1709/D3131_Containers/` - source and latex files in subdirectories for standard library proposal on containers; use container classification table (add more items if applicable)
- List all 26 trait files in `include/graph/container/traits/`
- List all 27 trait files in `include/graph/container/traits/`

- [x] **3.4.2** `CREATE` `docs/user-guide/containers.md`
- **Depends:** 3.4.1
- **Risk:** low
- **Action:** Write container guide. Structure per strategy §"Container Documentation
Requirements" — includes all 3 containers, selection guide, full 26-combination matrix,
abbreviation conventions, and example usage of `dynamic_graph` with non-default traits.
- **Verify:** File mentions all 3 containers with equal depth; 26 trait combinations listed;
- **Verify:** File mentions all 3 containers with equal depth; 27 trait combinations listed;
trait naming convention (`{vertex}o{edge}_graph_traits`) documented.

### 3.5 Move and update views
Expand Down Expand Up @@ -1016,7 +1016,7 @@ This was created in step 2.2.1. Skip if already done.
- Complete documentation reorganization: user guide, reference, contributor docs
- New README with badges, compiler table, feature highlights
- Separated adjacency list and edge list documentation
- Full container documentation including 26 dynamic_graph trait combinations
- Full container documentation including 27 dynamic_graph trait combinations
- Consolidated CPO implementation guide (from 3140 lines → ~1500)
- Created FAQ, migration guide, getting started, and examples pages
- Fixed algorithms.hpp umbrella header (6 broken includes)
Expand Down
6 changes: 3 additions & 3 deletions agents/doc_refactor_strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Transform the graph-v3 documentation from an internal development log into a pol
6. **Missing landing page for docs/** — no index or navigation
7. **Stale design documents** mixed with evergreen reference docs
8. **Edge list under-documented** — the edge list ADT is a peer to the adjacency list but gets ~25% of the space in `container_interface.md`; its namespace (`graph::edge_list`) and concept names (`basic_sourced_edgelist`) don't match the doc
9. **Container variety not showcased** — `dynamic_graph` supports 26 vertex×edge container combinations (4 vertex containers × 7 edge containers) but this power isn't visible to users
9. **Container variety not showcased** — `dynamic_graph` supports 27 vertex×edge container combinations (4 vertex containers × 7 edge containers) but this power isn't visible to users
10. **Orphaned files** — `descriptor.md` (top-level), `include/graph/README.md`, and several `docs/` files have no clear destination in the new structure

---
Expand Down Expand Up @@ -251,7 +251,7 @@ The `docs/user-guide/containers.md` page must include:
|-----------|---------|------------|----------|
| `dynamic_graph<EV,VV,GV,VId,Sourced,Traits>` | Traits-configured vertex and edge containers | Mutable | General purpose, flexible container choice |
| `compressed_graph<EV,VV,GV,VId,EIndex,Alloc>` | CSR (compressed sparse row) | Immutable after construction | Read-only, high-performance, memory-compact |
| `undirected_adjacency_list<VV,EV,GV,VId,VContainer,Alloc>` | Dual doubly-linked lists per edge | Mutable, O(1) edge removal | Undirected graphs, frequent edge insertion/removal |
| `undirected_adjacency_list<EV,VV,GV,VId,VContainer,Alloc>` | Dual doubly-linked lists per edge | Mutable, O(1) edge removal | Undirected graphs, frequent edge insertion/removal |

**Full `dynamic_graph` container matrix (26 combinations):**

Expand All @@ -278,7 +278,7 @@ Edge containers:

Traits naming convention: `{vertex}o{edge}_graph_traits` (e.g., `vov_graph_traits` = vector vertices, vector edges).

All 26 combinations listed with trait file names (vov, vod, vofl, vol, vos, vous, voem, dov, dod, dofl, dol, dos, dous, mov, mod, mofl, mol, mos, mous, moem, uov, uod, uofl, uol, uos, uous).
All 27 combinations listed with trait file names (vov, vod, vofl, vol, vos, vous, vom, voum, dov, dod, dofl, dol, dos, dous, mov, mod, mofl, mol, mos, mous, mom, uov, uod, uofl, uol, uos, uous).

### Phase 4: Reference

Expand Down
Loading
Loading