Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_bipartite.H
Go to the documentation of this file.
1/*
2 Aleph_w
3
4 Data structures & Algorithms
5 version 2.0.0b
6 https://github.com/lrleon/Aleph-w
7
8 This file is part of Aleph-w library
9
10 Copyright (c) 2002-2026 Leandro Rabindranath Leon
11
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13 of this software and associated documentation files (the "Software"), to deal
14 in the Software without restriction, including without limitation the rights
15 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 copies of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions:
18
19 The above copyright notice and this permission notice shall be included in all
20 copies or substantial portions of the Software.
21
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 SOFTWARE.
29*/
30
48#ifndef TPL_BIPARTITE_H
49#define TPL_BIPARTITE_H
50
51# include <ah-graph-concepts.H>
52
53#include <tpl_dynDlist.H>
54#include <tpl_dynMapTree.H>
55#include <tpl_dynListQueue.H>
56#include <tpl_net.H>
57#include <ah-errors.H>
58#include <cookie_guard.H>
59#include <tpl_dfs_stack.H>
60#include <limits>
61
62namespace Aleph {
69
70template <AlephGraph GT>
71static long &color(typename GT::Node *p)
72{
73 return NODE_COUNTER(p);
74}
75
76template <AlephGraph GT>
77static long &color(typename GT::Arc *a)
78{
79 return ARC_COUNTER(a);
80}
81
102template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
104 SA sa = SA())
105{
106 g.reset_nodes(); // initialize counters to White
107 g.reset_arcs();
108
109 if (g.get_num_nodes() == 0)
110 return;
111
113 for (Node_Iterator<GT> nit(g); nit.has_curr(); nit.next_ne())
114 {
115 typename GT::Node *p = nit.get_curr();
116 if (color<GT>(p) != Bp_White)
117 continue; // in a component already colored
118
119 color<GT>(p) = Bp_Red;
120 red.put(p);
121 l.put(p);
122
123 while (true)
124 if (not red.is_empty()) // any red node with unvisited arcs?
125 {
126 typename GT::Node *p = red.get();
127 for (Node_Arc_Iterator<GT, SA> it(p, sa); it.has_curr(); it.next_ne())
128 {
129 typename GT::Arc *a = it.get_curr();
130 ah_domain_error_if(color<GT>(a) == Bp_Red) << "Graph is not bipartite";
131 if (color<GT>(a) == Bp_Blue)
132 continue;
133
134 color<GT>(a) = Bp_Red;
135 typename GT::Node *q = it.get_tgt_node();
136 ah_domain_error_if(color<GT>(q) == Bp_Red) << "Graph is not bipartite";
137 if (color<GT>(q) == Bp_Blue)
138 continue;
139
140 color<GT>(q) = Bp_Blue;
141 blue.put(q);
142 r.put(q);
143 }
144 }
145 else if (not blue.is_empty()) // any blue node with unvisited arcs?
146 {
147 typename GT::Node *p = blue.get();
148 for (Node_Arc_Iterator<GT, SA> it(p, sa); it.has_curr(); it.next_ne())
149 {
150 typename GT::Arc *a = it.get_curr();
151 ah_domain_error_if(color<GT>(a) == Bp_Blue) << "Graph is not bipartite";
152 if (color<GT>(a) == Bp_Red)
153 continue;
154
155 color<GT>(a) = Bp_Blue;
156
157 typename GT::Node *q = it.get_tgt_node();
158 ah_domain_error_if(color<GT>(q) == Bp_Blue) << "Graph is not bipartite";
159 if (color<GT>(q) == Bp_Red)
160 continue;
161
162 color<GT>(q) = Bp_Red;
163 red.put(q);
164 l.put(q);
165 }
166 }
167 else
168 break;
169 }
170}
171
180template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
182{
183 SA sa;
184
185public:
190 explicit Compute_Bipartite(SA __sa = SA()) : sa(std::move(__sa)) {}
191
202 {
203 compute_bipartite<GT, SA>(g, l, r, sa);
204 }
205};
206
232template <AlephGraph GT, template <class> class Max_Flow = Ford_Fulkerson_Maximum_Flow, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
235 SA sa = SA())
236{
237 if (g.get_num_nodes() == 0)
238 return;
239
241
242 compute_bipartite<GT, SA>(g, l, r, sa); // with the arcs of the net
243
244 // An integer flow: the capacities are 1, and with a floating flow
245 // Ford-Fulkerson takes the shortest paths, some 3.5 times slower here
247 AN net;
248
249 // Cookie_Guard ensures cookies are cleared when a function exits
250 // (prevents dangling pointers to destroyed 'net' nodes)
251 Cookie_Guard<GT> cookie_guard(g, true, true);
252
253 // Use a map to store arc mapping since Max_Flow algorithms reset cookies
255
256 // traverse nodes of g and insert their image in the net. A node without
257 // arcs, which matches no other, stays out of it: with no arcs in the net
258 // either, it would be a source and a sink of the net, which must have one
259 // of each
260 bool has_arcs = false;
261 for (Node_Iterator<GT> it(g); it.has_curr(); it.next_ne())
262 {
263 typename GT::Node *p = it.get_curr();
264 if (not Node_Arc_Iterator<GT, SA>(p, sa).has_curr())
265 continue;
266 has_arcs = true;
267 NODE_COOKIE(p) = net.insert_node();
268 }
269
270 if (not has_arcs)
271 return;
272
273 typename AN::Node *source = net.insert_node();
274
275 // traverse nodes of l, connect them to the source and insert their arcs
276 for (typename DynDlist<typename GT::Node *>::Iterator i(l); i.has_curr(); i.next_ne())
277 {
278 typename GT::Node *p = i.get_curr();
279 if (NODE_COOKIE(p) == nullptr)
280 continue; // without arcs
281 typename AN::Node *src = mapped_node<GT, AN>(p);
282 net.insert_arc(source, src, 1);
283
284 for (Node_Arc_Iterator<GT, SA> j(p, sa); j.has_curr(); j.next_ne())
285 {
286 typename GT::Arc *arc = j.get_current_arc_ne();
287 // the other end from p, which may be the source of the arc
288 typename AN::Node *tgt = mapped_node<GT, AN>(g.get_connected_node(arc, p));
289 typename AN::Arc *a = net.insert_arc(src, tgt, 1);
290 // Store mapping in map (not cookies, which are cleared by Max_Flow)
291 arc_map.insert(a, arc);
292 }
293 }
294
295 typename AN::Node *sink = net.insert_node();
296
297 // traverse nodes of r and connect them to the sink; each has an arc,
298 // since compute_bipartite() puts in r only nodes that it reaches by one
299 for (typename DynDlist<typename GT::Node *>::Iterator it(r); it.has_curr(); it.next_ne())
300 {
301 typename GT::Node *p = it.get_curr();
302 net.insert_arc(mapped_node<GT, AN>(p), sink, 1);
303 }
304
305 Max_Flow<AN>()(net);
306
307 for (Arc_Iterator<AN> it(net); it.has_curr(); it.next_ne())
308 {
309 typename AN::Arc *a = it.get_curr();
310 if (a->flow == 0)
311 continue;
312
313 // Look up the original arc in our map
314 auto *pair_ptr = arc_map.search(a);
315 if (pair_ptr == nullptr)
316 continue;
317
318 matching.append(pair_ptr->second);
319 }
320}
321
332template <AlephGraph GT, template <class> class Max_Flow = Ford_Fulkerson_Maximum_Flow, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
334{
335 SA sa;
336
337public:
343 : sa(std::move(__sa)) {}
344
360 {
361 compute_maximum_cardinality_bipartite_matching<GT, Max_Flow, SA>(g, matching, sa);
362 }
363};
364
379template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
383 SA sa = SA())
384{
385 using Node = typename GT::Node;
386
387 g.reset_nodes();
388 g.reset_arcs();
389
390 for (Node_Iterator<GT> nit(g); nit.has_curr(); nit.next_ne())
391 {
392 Node *start = nit.get_curr();
393 if (color<GT>(start) != Bp_White)
394 continue;
395
396 color<GT>(start) = Bp_Red;
397 l.append(start);
398
400 queue.put(start);
401
402 while (not queue.is_empty())
403 {
404 Node *p = queue.get();
405 const long p_color = color<GT>(p);
406 const long neighbor_color = (p_color == Bp_Red) ? Bp_Blue : Bp_Red;
407
408 for (Node_Arc_Iterator<GT, SA> it(p, sa); it.has_curr(); it.next_ne())
409 if (Node *q = it.get_tgt_node(); color<GT>(q) == Bp_White)
410 {
411 color<GT>(q) = neighbor_color;
412 if (neighbor_color == Bp_Red)
413 l.append(q);
414 else
415 r.append(q);
416 queue.put(q);
417 }
418 else if (color<GT>(q) == p_color)
419 return false;
420 }
421 }
422
423 return true;
424}
425
428template <AlephGraph GT, ArcFilter<GT> SA>
430{
431 typename GT::Node *u;
433
434 [[gnu::always_inline]] ALEPH_FLATTEN
435 Hopcroft_Karp_Frame(typename GT::Node *n, const SA &sa) : u(n), it(n, sa) {}
436
437 [[gnu::always_inline]] ALEPH_FLATTEN
438 void next_arc() noexcept(noexcept(it.next_ne())) { it.next_ne(); }
439};
440
441// Moves the iterator of f to the next arc that goes to a free right node,
442// which it gives with free set, or to a right node whose partner is in the
443// next layer, which it gives; nullptr when the arcs of f.u are done
444template <AlephGraph GT, ArcFilter<GT> SA>
445[[gnu::always_inline]] ALEPH_FLATTEN inline typename GT::Node *
447 noexcept(noexcept(f.it.next_ne()))
448{
449 using Arc = typename GT::Arc;
450
451 const long u_dist = NODE_COUNTER(f.u);
452 for (; f.it.has_curr(); f.it.next_ne())
453 {
454 Arc *arc = f.it.get_current_arc_ne();
455 auto v = g.get_connected_node(arc, f.u); // right-side node
456
457 // v's match partner (maybe nullptr if v is free)
458 Arc *match_arc = static_cast<Arc *>(NODE_COOKIE(v));
459 if (match_arc == nullptr) // v is free → augmenting path found
460 {
461 free = true;
462 return v;
463 }
464
465 // the partner of v is a left-side node matched to v
466 if (auto pair_v = g.get_connected_node(match_arc, v);
467 NODE_COUNTER(pair_v) == u_dist + 1)
468 return pair_v;
469 }
470 return nullptr;
471}
472
473// Matches the left node of f through the arc on which its iterator stays
474template <AlephGraph GT, ArcFilter<GT> SA>
475[[gnu::always_inline]] inline void
477{
478 auto a = f.it.get_current_arc_ne();
479 NODE_COOKIE(f.u) = a;
480 NODE_COOKIE(g.get_connected_node(a, f.u)) = a;
481 NODE_COUNTER(f.u) = std::numeric_limits<long>::max();
482}
483
484// Helper: DFS for augmenting path in Hopcroft-Karp.
485// Returns true if an augmenting path from u to a free right-node
486// was found and the matching was augmented along it. A path can have as
487// many nodes as the graph, too many for recursion, so that the search
488// keeps its own stack, frames, empty when it starts and when it ends; the
489// order of the visits is that of a recursion. The node being visited keeps
490// its frame in here until it visits another; then the frame waits in
491// frames, where it goes on when the search comes back. Each frame copies
492// sa, the filter of the arcs, and here is a Dfs_Here, which assigns the
493// frames if the filter can be assigned.
494template <AlephGraph GT, ArcFilter<GT> SA>
495static bool hopcroft_karp_dfs(const GT &g, typename GT::Node *u,
497 const SA &sa)
498{
499 using Node = typename GT::Node;
500 using Frame = Hopcroft_Karp_Frame<GT, SA>;
501
502 constexpr long INF = std::numeric_limits<long>::max();
503
504 // the nodes of the path that the frames keep, from the last, are matched
505 auto match_frames = [&g, &frames]()
506 {
507 while (not frames.is_empty())
508 {
509 hopcroft_karp_match(g, frames.top());
510 frames.pop();
511 }
512 };
513
514 auto here = dfs_here<Frame>(u, sa);
515 while (true)
516 {
517 bool free = false;
518 if (Node *next = hopcroft_karp_next(g, dfs_frame(here), free))
519 {
520 if (free)
521 {
523 match_frames();
524 return true;
525 }
526
527 frames.push(std::move(dfs_frame(here))); // the iterator stays on the arc
528 dfs_replace(here, next, sa);
529 continue;
530 }
531
532 NODE_COUNTER(dfs_frame(here).u) = INF; // mark u as "dead" for this phase
533 while (true) // back to the nodes that wait
534 {
535 if (frames.is_empty())
536 return false;
537
538 Frame &f = frames.top();
539 f.next_arc(); // no path through the arc to the node that died
540 if (Node *next = hopcroft_karp_next(g, f, free))
541 {
542 if (free)
543 {
544 match_frames();
545 return true;
546 }
547
548 dfs_replace(here, next, sa);
549 break;
550 }
551
552 NODE_COUNTER(f.u) = INF;
553 frames.pop();
554 }
555 }
556}
557
574template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
576 SA sa = SA())
577{
578 using Node = typename GT::Node;
579 using Arc = typename GT::Arc;
580
581 constexpr long INF = std::numeric_limits<long>::max();
582
583 if (g.get_num_nodes() == 0)
584 return;
585
586 DynDlist<Node *> left_nodes, right_nodes;
587
588 // 2-coloring (uses NODE_COUNTER for color)
589 const bool is_bipartite = compute_bipartite_all_components<GT, SA>(g, left_nodes, right_nodes, sa);
590 ah_domain_error_if(not is_bipartite) << "Graph is not bipartite";
591
592 // Now repurpose NODE_COOKIE for matching arcs and
593 // NODE_COUNTER for BFS distances (left-side only).
594 // Cookie_Guard clears cookies on exit.
595 Cookie_Guard<GT> cookie_guard(g, true, false);
596
597 // Initialize: all nodes are free (NODE_COOKIE = nullptr already from guard)
598 // Set all left-side distances to INF
599 for (auto it = left_nodes.get_it(); it.has_curr(); it.next_ne())
600 NODE_COUNTER(it.get_curr()) = INF;
601 for (auto it = right_nodes.get_it(); it.has_curr(); it.next_ne())
602 NODE_COUNTER(it.get_curr()) = 0; // right-side counters unused
603
604 // BFS phase: returns true if augmenting paths exist
605 // Sets distances on left-side nodes
606 auto bfs = [&]() -> bool
607 {
609 long dist_to_free = INF;
610
611 // Enqueue all free left-side nodes at distance 0
612 for (auto it = left_nodes.get_it(); it.has_curr(); it.next_ne())
613 if (Node *u = it.get_curr(); NODE_COOKIE(u) == nullptr) // u is free
614 {
615 NODE_COUNTER(u) = 0;
616 queue.put(u);
617 }
618 else
619 NODE_COUNTER(u) = INF;
620
621 while (not queue.is_empty())
622 {
623 Node *u = queue.get();
624 const long u_dist = NODE_COUNTER(u);
625
626 if (u_dist >= dist_to_free)
627 continue;
628
629 for (Node_Arc_Iterator<GT, SA> it(u, sa); it.has_curr(); it.next_ne())
630 {
631 Arc *arc = it.get_current_arc_ne();
632 Node *v = g.get_connected_node(arc, u); // right-side
633
634 Arc *match_arc = static_cast<Arc *>(NODE_COOKIE(v));
635 Node *pair_v = (match_arc != nullptr) ? g.get_connected_node(match_arc, v) : nullptr;
636
637 if (pair_v == nullptr) // v is free
638 dist_to_free = u_dist + 1;
639 else if (NODE_COUNTER(pair_v) == INF)
640 {
641 NODE_COUNTER(pair_v) = u_dist + 1;
642 queue.put(pair_v);
643 }
644 }
645 }
646
647 return dist_to_free != INF;
648 };
649
650 // Main loop: BFS + DFS phases; the searches share their stack
652 while (bfs())
653 {
654 for (auto it = left_nodes.get_it(); it.has_curr(); it.next_ne())
655 if (Node *u = it.get_curr(); NODE_COOKIE(u) == nullptr) // u is free
656 hopcroft_karp_dfs<GT, SA>(g, u, frames, sa);
657 }
658
659 // Collect matching arcs from left-side nodes
661 for (auto it = left_nodes.get_it(); it.has_curr(); it.next_ne())
662 {
663 Arc *a = static_cast<Arc *>(NODE_COOKIE(it.get_curr()));
664 if (a != nullptr and not seen.contains(a))
665 {
666 matching.append(a);
667 seen.insert(a);
668 }
669 }
670}
671
678template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
680{
681 SA sa;
682
683public:
688 explicit Hopcroft_Karp_Matching(SA __sa = SA()) : sa(std::move(__sa)) {}
689
697 {
698 hopcroft_karp_matching<GT, SA>(g, matching, sa);
699 }
700};
701} // end namespace Aleph
702
703#endif // TPL_BIPARTITE_H
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
Definition ah-errors.H:670
C++20 concepts for the protocol shared by graph algorithms.
WeightedDigraph::Node Node
WeightedDigraph::Arc Arc
Class that takes a bipartite graph and computes the partition sets.
void operator()(const GT &g, DynDlist< typename GT::Node * > &l, DynDlist< typename GT::Node * > &r)
Computes the partition sets of a bipartite graph.
Compute_Bipartite(SA __sa=SA())
Builds the computation with the filter of the arcs.
Class for computing the maximum cardinality matching of a bipartite graph.
void operator()(const GT &g, DynDlist< typename GT::Arc * > &matching)
Computes the maximum bipartite matching of a graph.
Compute_Maximum_Cardinality_Bipartite_Matching(SA __sa=SA())
Builds the computation with the filter of the arcs.
RAII guard that clears graph cookies on destruction.
Stack of the frames of a depth-first search that does not recurse.
Iterator dynamic list.
Dynamic doubly linked list with O(1) size and bidirectional access.
T & append(const T &item)
Append a copied item at the end of the list.
T & put(const T &item)
See append(const T & item).
T get()
See remove_first().
Dynamic queue of elements of generic type T based on single linked list.
T & put(const T &data)
The type of element.
T get()
Remove the oldest item of the queue.
bool is_empty() const noexcept
Return true if this is empty.
T & append(const T &item)
Definition htlist.H:1362
T & put(const T &item)
See insert(const T & item).
Definition htlist.H:1341
Generic key-value map implemented on top of a binary search tree.
Pair * search(const Key &key) noexcept(nothrow_search)
Collect all keys.
Pair * insert(const Key &key, const Data &data)
Insert a key-value pair.
Dynamic set implemented using AVL binary search trees of type Avl_Tree<Key>.
Key * insert(const Key &key)
Inserts a key into the dynamic set.
bool contains(const Key &key) const
Checks if a key exists in the set.
void next_ne() noexcept(shows_ne)
Advances the iterator to the next filtered element, as next() does.
Functor wrapper for hopcroft_karp_matching.
Hopcroft_Karp_Matching(SA __sa=SA())
Builds the computation with the filter of the arcs.
void operator()(const GT &g, DynDlist< typename GT::Arc * > &matching)
Computes the maximum matching using Hopcroft-Karp.
Filtered iterator on the nodes of a graph.
Definition tpl_graph.H:1287
void reset_arcs() const
Reset all the arcs of graph (the control bits, the state, the counter and the cookie)
Definition graph-dry.H:1213
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
Definition graph-dry.H:975
Node * get_connected_node(Arc *arc, Node *node) const noexcept
Return the adjacent node to node through arc.
Definition graph-dry.H:1058
void reset_nodes() const
Reset all the nodes of graph (the control bits, the state, the counter and the cookie)
Definition graph-dry.H:1206
auto get_it()
Return a properly initialized iterator positioned at the first item on the container.
Definition ah-dry.H:663
RAII guards for graph node/arc cookies.
void compute_bipartite(const GT &g, DynDlist< typename GT::Node * > &l, DynDlist< typename GT::Node * > &r, SA sa=SA())
Computes the partition sets of a bipartite graph.
void compute_maximum_cardinality_bipartite_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Computes the maximum cardinality matching of a bipartite graph.
void dfs_replace(T &here, Args &&...args)
Replaces the frame that a Dfs_Here holds with one built with args, by assignment.
#define NODE_COUNTER(p)
Get the counter of a node.
#define ARC_COUNTER(p)
Return the counter of arc p.
bool compute_bipartite_all_components(const GT &g, DynDlist< typename GT::Node * > &l, DynDlist< typename GT::Node * > &r, SA sa=SA())
Computes the partition sets of a bipartite graph handling all connected components.
void hopcroft_karp_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Computes a maximum cardinality matching on a bipartite graph using the Hopcroft-Karp algorithm.
#define NODE_COOKIE(p)
Return the node cookie
T & dfs_frame(T &here) noexcept
The frame that a Dfs_Here holds.
#define ALEPH_FLATTEN
[[gnu::flatten]], or nothing where it would only make the compilation slower.
Main namespace for Aleph-w library functions.
GT::Node * hopcroft_karp_next(const GT &g, Hopcroft_Karp_Frame< GT, SA > &f, bool &free) noexcept(noexcept(f.it.next_ne()))
static bool hopcroft_karp_dfs(const GT &g, typename GT::Node *u, Dfs_Stack< Hopcroft_Karp_Frame< GT, SA > > &frames, const SA &sa)
and
Check uniqueness with explicit hash + equality functors.
bool has_curr() const noexcept
Return true if all underlying iterators are positioned on a valid item.
Definition ah-zip.H:173
void next()
Advance all underlying iterators (bounds-checked).
Definition ah-zip.H:236
void hopcroft_karp_match(const GT &g, Hopcroft_Karp_Frame< GT, SA > &f) noexcept
void next_ne() noexcept(noexcept(std::declval< Aleph::const_iterator_t< HeadC > & >().next_ne()) and noexcept(std::declval< ZipIterator< TailC... > & >().next_ne()))
Advance all underlying iterators (unchecked variant).
Definition ah-zip.H:252
static long & color(typename GT::Node *p)
STL namespace.
Filtered iterator on all the arcs of a graph.
Definition tpl_graph.H:1200
Default filter for filtered iterators on arcs.
Definition tpl_graph.H:1024
Functor wrapper for ford_fulkerson_maximum_flow().
Definition tpl_net.H:2320
A left node that the search for an augmenting path goes through, and the next of its arcs to look at,...
Hopcroft_Karp_Frame(typename GT::Node *n, const SA &sa)
Node_Arc_Iterator< GT, SA > it
void next_arc() noexcept(noexcept(it.next_ne()))
Arc of a flow network implemented with adjacency lists.
Definition tpl_net.H:160
Flow network implemented with adjacency lists.
Definition tpl_net.H:311
Filtered iterator of adjacent arcs of a node.
Definition tpl_graph.H:1155
Gsl_Compatible_Rng r
Stack of the frames of a depth-first search that does not recurse.
Dynamic doubly linked list implementation.
Dynamic queue implementation based on linked lists.
Dynamic key-value map based on balanced binary search trees.
Network flow graph structures.
DynList< int > l