11/*
22 * Kruskal's Algorithm
33 */
4- template <x_index_edgelist_range IELR, x_index_edgelist_range OELR>
5- auto kruskal (IELR&& e, OELR&& t);
4+ template <x_index_edgelist_range IELR, x_index_edgelist_range OELR,
5+ class Alloc = allocator<byte>>
6+ auto kruskal (IELR&& e, OELR&& t, const Alloc& alloc = Alloc());
67
7- template <x_index_edgelist_range IELR, x_index_edgelist_range OELR, class CompareOp >
8- auto kruskal (IELR&& e, OELR&& t, CompareOp compare);
8+ template <x_index_edgelist_range IELR, x_index_edgelist_range OELR, class CompareOp ,
9+ class Alloc = allocator<byte>>
10+ auto kruskal (IELR&& e, OELR&& t, CompareOp compare, const Alloc& alloc = Alloc());
911
1012/*
1113 * Inplace Kruskal's Algorithm
1214 */
13- template <x_index_edgelist_range IELR, x_index_edgelist_range OELR>
15+ template <x_index_edgelist_range IELR, x_index_edgelist_range OELR,
16+ class Alloc = allocator<byte>>
1417requires permutable<iterator_t <IELR>>
15- auto inplace_kruskal (IELR&& e, OELR&& t);
18+ auto inplace_kruskal (IELR&& e, OELR&& t, const Alloc& alloc = Alloc() );
1619
17- template <x_index_edgelist_range IELR, x_index_edgelist_range OELR, class CompareOp >
20+ template <x_index_edgelist_range IELR, x_index_edgelist_range OELR, class CompareOp ,
21+ class Alloc = allocator<byte>>
1822requires permutable<iterator_t <IELR>>
19- auto inplace_kruskal (IELR&& e, OELR&& t, CompareOp compare);
23+ auto inplace_kruskal (IELR&& e, OELR&& t, CompareOp compare, const Alloc& alloc = Alloc() );
2024
2125/*
2226 * Prim's Algorithm
@@ -26,7 +30,8 @@ template <adjacency_list G,
2630 class PredecessorFn ,
2731 class WF = function<distance_fn_value_t <WeightFn, G>(const remove_reference_t <G>&,
2832 const edge_t <G>&)>,
29- class CompareOp = less<distance_fn_value_t <WeightFn, G>>>
33+ class CompareOp = less<distance_fn_value_t <WeightFn, G>>,
34+ class Alloc = allocator<byte>>
3035requires distance_fn_for<WeightFn, G> &&
3136 is_arithmetic_v<distance_fn_value_t <WeightFn, G>> &&
3237 predecessor_fn_for<PredecessorFn, G> &&
@@ -37,4 +42,5 @@ auto prim(G&& g,
3742 WeightFn&& weight,
3843 PredecessorFn&& predecessor,
3944 WF&& weight_fn = [](const auto & gr, const edge_t <G>& uv) { return edge_value (gr, uv); },
40- CompareOp compare = less<distance_fn_value_t <WeightFn, G>>());
45+ CompareOp compare = less<distance_fn_value_t <WeightFn, G>>(),
46+ const Alloc& alloc = Alloc());
0 commit comments