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
Choosing the correct memory layout is critical for algorithmic performance. CPP-GL abstracts this choice entirely behind the `ImplTag`, allowing you to swap layouts without altering a single line of traversal code.
142
+
Choosing the correct memory layout is critical for algorithmic performance. CPP-GL abstracts this choice entirely behind the `ReprTag`, allowing you to swap layouts without altering a single line of traversal code.
143
143
144
144
### Fundamental Representations
145
145
@@ -161,21 +161,21 @@ Consider the following graph:
161
161
162
162
CPP-GL currently categorizes its memory layouts into two primary families based on their underlying memory allocation strategy.
163
163
164
-
> [!NOTE] All representation model tag types are defined in the `gl::impl` namespace.
164
+
> [!NOTE] All representation model tag types are defined in the `gl::repr` namespace.
165
165
166
166
#### Standard Models
167
167
168
168
Heap-allocated, nested structures that prioritize flexibility and dynamic structural modification.
169
169
170
-
-[**list_t**](../cpp-gl/structgl_1_1impl_1_1list__t.md): A standard Adjacency List model implemented using traditional nested containers (e.g., `std::vector<std::vector<T>>`).
171
-
-[**matrix_t**](../cpp-gl/structgl_1_1impl_1_1matrix__t.md): A standard Adjacency Matrix model implemented using traditional nested containers.
170
+
-[**list_t**](../cpp-gl/structgl_1_1repr_1_1list__t.md): A standard Adjacency List model implemented using traditional nested containers (e.g., `std::vector<std::vector<T>>`).
171
+
-[**matrix_t**](../cpp-gl/structgl_1_1repr_1_1matrix__t.md): A standard Adjacency Matrix model implemented using traditional nested containers.
172
172
173
173
### Flat Models
174
174
175
175
Contiguous 1D memory blocks that prioritize cache locality and maximum traversal speed over modification speed.
176
176
177
-
-[**flat_list_t**](../cpp-gl/structgl_1_1impl_1_1flat__list__t.md): A flattened Adjacency List model implemented using the generic [**flat_jagged_vector**](../cpp-gl/classgl_1_1flat__jagged__vector.md) data structure.
178
-
-[**flat_matrix_t**](../cpp-gl/structgl_1_1impl_1_1flat__matrix__t.md): A flattened Adjacency Matrix model implemented using the generic [**flat_matrix**](../cpp-gl/classgl_1_1flat__matrix.md) data structure.
177
+
-[**flat_list_t**](../cpp-gl/structgl_1_1repr_1_1flat__list__t.md): A flattened Adjacency List model implemented using the generic [**flat_jagged_vector**](../cpp-gl/classgl_1_1flat__jagged__vector.md) data structure.
178
+
-[**flat_matrix_t**](../cpp-gl/structgl_1_1repr_1_1flat__matrix__t.md): A flattened Adjacency Matrix model implemented using the generic [**flat_matrix**](../cpp-gl/classgl_1_1flat__matrix.md) data structure.
179
179
180
180
### Topology Support: Simple Graphs and Multigraphs
181
181
@@ -204,7 +204,7 @@ Being "edge-aware" means that the internal representation stores the specific `e
204
204
205
205
#### Standard Memory Models
206
206
207
-
The standard implementations utilize traditional, nested 2D containers (e.g., `std::vector<std::vector<T>>`).
207
+
The standard model implementations utilize traditional, nested 2D containers (e.g., `std::vector<std::vector<T>>`).
208
208
209
209
These models are highly flexible. Because the inner containers can grow independently, they handle structural modifications, like adding vertices or edges, gracefully. The trade-off is that the memory is fragmented across the heap, which can lead to cache misses during heavy graph traversals.
210
210
@@ -250,11 +250,11 @@ Depending on the chosen representation model, the computational complexity of st
250
250
251
251
### Choosing the Layout
252
252
253
-
Selecting the right `ImplTag` is a balance of your specific operational needs - use:
253
+
Selecting the right `ReprTag` is a balance of your specific operational needs - use:
254
254
255
-
-[**list_t**](../cpp-gl/structgl_1_1impl_1_1list__t.md) for highly dynamic, sparse graphs where the topology changes frequently.
256
-
-[**flat_list_t**](../cpp-gl/structgl_1_1impl_1_1flat__list__t.md) for static, sparse graphs where traversal speed and cache locality are paramount.
257
-
-[**matrix_t**](../cpp-gl/structgl_1_1impl_1_1matrix__t.md) (or [**flat_matrix_t**](../cpp-gl/structgl_1_1impl_1_1flat__matrix__t.md) if structure is entirely static) for highly dense graphs (where $\vert E \vert \approx \vert V \vert^2$) when instant $O(1)$ edge lookups are strictly required and memory footprint is not a bottleneck.
255
+
-[**list_t**](../cpp-gl/structgl_1_1repr_1_1list__t.md) for highly dynamic, sparse graphs where the topology changes frequently.
256
+
-[**flat_list_t**](../cpp-gl/structgl_1_1repr_1_1flat__list__t.md) for static, sparse graphs where traversal speed and cache locality are paramount.
257
+
-[**matrix_t**](../cpp-gl/structgl_1_1repr_1_1matrix__t.md) (or [**flat_matrix_t**](../cpp-gl/structgl_1_1repr_1_1flat__matrix__t.md) if structure is entirely static) for highly dense graphs (where $\vert E \vert \approx \vert V \vert^2$) when instant $O(1)$ edge lookups are strictly required and memory footprint is not a bottleneck.
/// > - *Note:* In simple graphs, this simplifies to \f$O(|E| \log |V|)\f$. However, because list models allow multigraphs, the queue size and operations scale strictly with \f$|E|\f$.
0 commit comments