114 <<
"edge_connectivity() does not work on digraphs";
121 long min_degree = std::numeric_limits<long>::max();
124 auto p = it.get_curr();
129 if (degree < min_degree)
152 auto p = it.get_curr();
161 auto a = it.get_curr();
168 long min_k = min_degree;
175 auto node = it.get_curr();
183 const auto sink = it.get_curr();
274 <<
"compute_min_cut() does not work on digraphs";
281 long min_degree = std::numeric_limits<long>::max();
284 auto p = it.get_curr();
289 if (degree < min_degree)
301 auto p = it.get_curr();
317 auto p = it.get_curr();
325 auto arc = it.get_curr();
341 auto p = it.get_curr();
352 auto a = it.get_curr();
366 long min_k = std::numeric_limits<long>::max();
372 if (
auto node = it.get_curr(); node != source)
378 auto sink = it.get_curr();
394 it.has_curr(); it.next_ne())
395 if (
auto node = it.get_curr();
net_node_map.contains(node))
399 it.has_curr(); it.next_ne())
400 if (
auto node = it.get_curr();
net_node_map.contains(node))
405 if (
auto arc = it.get_curr();
net_arc_map.contains(arc))
410 if (
auto arc = it.get_curr();
net_arc_map.contains(arc))
426 it.has_curr(); it.next_ne())
430 it.has_curr(); it.next_ne())
436 typename Net::Arc *arc = it.get_curr();
501 <<
"vertex_connectivity() does not work on digraphs";
508 long min_degree = std::numeric_limits<long>::max();
511 auto p = it.get_curr();
516 if (degree < min_degree)
538 auto p = it.get_curr();
544 auto a = it.get_curr();
551 long min_k = min_degree;
555 auto source =
k.get_curr();
568 auto sink = j.get_curr();
588 auto p = it.get_curr();
589 if (p == source
or p == sink)
602 auto a = it.get_curr();
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
List_Graph< Graph_Node< Node_Info >, Graph_Arc< Arc_Info > > GT
Functor wrapper for compute_min_cut().
long operator()(GT &g, DynSetTree< typename GT::Node * > &l, DynSetTree< typename GT::Node * > &r, DynDlist< typename GT::Arc * > &cut)
Compute a minimum edge cut for g.
RAII guard that clears graph cookies on destruction.
Stateful depth-first traversal functor.
bool has_curr() const noexcept
Return true the iterator has an current arc.
bool has_curr() const noexcept
Return true if the iterator has current item.
Dynamic doubly linked list with O(1) size and bidirectional access.
void empty() noexcept
@brief Empties the container.
T & append(const T &item)
Append a copied item at the end of the list.
Iterator on the items of list.
Dynamic singly linked list with functional programming support.
T & insert(const T &item)
void empty() noexcept
empty the list
Dynamic map implemented with a treap.
Pair * insert(const Key &key, const Data &data)
Insert a key-value pair.
Data & find(const Key &key)
Find the value associated with key.
Dynamic set backed by balanced binary search trees with automatic memory management.
Functor wrapper for edge_connectivity().
long operator()(GT &g)
Compute edge connectivity of g.
void next()
Advances the iterator to the next filtered element.
void next_ne() noexcept
Advances the iterator to the next filtered element (noexcept version).
bool has_curr() const noexcept
Filtered iterator on the nodes of a graph.
Node * get_src_node(Arc *arc) const noexcept
Return the source node of arc (only for directed graphs)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
bool is_digraph() const noexcept
Return true if the graph this is directed.
Node * get_connected_node(Arc *arc, Node *node) const noexcept
Return the adjacent node to node through arc.
Node * get_tgt_node(Arc *arc) const noexcept
Return the target node of arc (only for directed graphs)
static void map_nodes(N1 *p, N2 *q) noexcept
Map the nodes through their cookies.
RAII guards for graph node/arc cookies.
long edge_connectivity(GT &g)
Compute edge connectivity (arc connectivity) of an undirected graph.
#define ARC_COOKIE(p)
Return the arc cookie
long compute_min_cut(GT &g, DynSetTree< typename GT::Node * > &l, DynSetTree< typename GT::Node * > &r, DynDlist< typename GT::Arc * > &cut)
Compute a minimum edge cut of an undirected graph.
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
#define NODE_COOKIE(p)
Return the node cookie
long vertex_connectivity(GT &g)
Compute vertex connectivity of an undirected graph.
Net_Graph< Net_Node< string >, Net_Arc< Empty_Class, FlowType > > Net
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Filtered iterator on all the arcs of a graph.
Default filter for filtered iterators on arcs.
Functor wrapper for heap_preflow_maximum_flow().
Arc of a flow network implemented with adjacency lists.
Flow network implemented with adjacency lists.
Node * insert_node(const Node_Type &node_info)
Insert a new node by copying node_info.
Arc * connect_arc(Arc *arc)
Connect a previously disconnected arc.
Arc * insert_arc(Node *src_node, Node *tgt_node, const Flow_Type &cap, const Flow_Type &flow, const typename Arc::Arc_Type &arc_info=Arc_Type())
Insert a capacitated arc with an initial flow.
void disconnect_arc(Arc *arc) noexcept
Disconnect arc arc from the graph without deleting it.
typename Arc::Flow_Type Flow_Type
Capacity/flow numeric type.
void remove_node(Node *p) noexcept override
Remove node p and all its arcs from the network.
void reset()
Reset all arc flows to zero.
Filtered iterator of adjacent arcs of a node.
Functor wrapper for random_preflow_maximum_flow().
Dynamic set implementations based on balanced binary search trees.
Network flow graph structures.