Skip to content

Add allocator support to graph algorithms#24

Merged
pratzl merged 1 commit intomainfrom
algo_alloc
Apr 16, 2026
Merged

Add allocator support to graph algorithms#24
pratzl merged 1 commit intomainfrom
algo_alloc

Conversation

@pratzl
Copy link
Copy Markdown
Collaborator

@pratzl pratzl commented Apr 16, 2026

Add class Alloc = std::allocator<std::byte> template parameter and const Alloc& alloc = Alloc() function parameter to all algorithms that use internal dynamic containers (queue, stack, vector): breadth_first_search, depth_first_search, articulation_points, biconnected_components, topological_sort, tarjan_scc, connected_components, dijkstra_shortest_paths/distances, and mst (kruskal, inplace_kruskal, prim).

Internal containers are constructed via allocator rebind so callers can supply a custom allocator (e.g. a pool allocator) to control heap usage of algorithm temporaries.

Also update Doxygen header docs (@tparam Alloc / @param alloc) and user-guide reference docs (signatures + parameter tables) for all affected algorithms. Examples are unchanged — allocator is optional and defaults transparently.

Add `class Alloc = std::allocator<std::byte>` template parameter and
`const Alloc& alloc = Alloc()` function parameter to all algorithms
that use internal dynamic containers (queue, stack, vector):
breadth_first_search, depth_first_search, articulation_points,
biconnected_components, topological_sort, tarjan_scc,
connected_components, dijkstra_shortest_paths/distances, and mst
(kruskal, inplace_kruskal, prim).

Internal containers are constructed via allocator rebind so callers
can supply a custom allocator (e.g. a pool allocator) to control
heap usage of algorithm temporaries.

Also update Doxygen header docs (@tparam Alloc / @param alloc) and
user-guide reference docs (signatures + parameter tables) for all
affected algorithms. Examples are unchanged — allocator is optional
and defaults transparently.
@pratzl pratzl merged commit 04546ad into main Apr 16, 2026
11 checks passed
@pratzl pratzl deleted the algo_alloc branch April 16, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant