87# ifndef TPL_CUT_NODES_H
88# define TPL_CUT_NODES_H
152 template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
172 auto arc = i.get_curr();
176 auto tgt = i.get_tgt_node();
241 auto tgt = it.get_tgt_node();
245 auto arc = it.get_curr();
275 auto arc = it.get_curr();
279 auto tgt = it.get_tgt_node();
295 auto arc = it.get_curr();
299 auto tgt_node = it.get_tgt_node();
343 auto garc = i.get_curr();
349 auto gtgt = i.get_tgt_node();
435 <<
"Cut nodes have not been computed or the class is in another phase";
469 for (
typename GT::Node_Iterator it(*
gptr); it.has_curr(); it.next_ne())
471 first = it.get_curr();
473 if (first ==
nullptr)
517 auto gp = it.get_curr();
531 auto garc = it.get_curr();
544 assert(src !=
nullptr and tgt !=
nullptr);
591 for (
typename GT::Node_Iterator it(*
gptr); it.has_curr(); it.next_ne())
593 auto p = it.get_curr();
653 template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
667 auto arc = it.get_curr();
668 if (arc == parent_arc)
671 auto tgt = it.get_tgt_node();
807 template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
818 template <AlephGraph GT>
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
#define ah_logic_error_if(C)
Throws std::logic_error if condition holds.
#define ah_invalid_argument_if(C)
Throws std::invalid_argument if condition holds.
C++20 concepts for the protocol shared by graph algorithms.
List_Graph< Graph_Node< Node_Info >, Graph_Arc< Arc_Info > > GT
Find bridge edges (isthmuses) of a connected undirected graph.
DynList< typename GT::Arc * > operator()(typename GT::Node *start)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Compute_Bridges(const GT &g, SA sa=SA())
Constructor.
DynList< typename GT::Arc * > find_bridges()
This is an overloaded member function, provided for convenience. It differs from the above function o...
DynList< typename GT::Arc * > find_bridges(typename GT::Node *start)
Find all bridge edges in the graph, starting from start.
DynList< typename GT::Arc * > operator()()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void __dfs(typename GT::Node *p, typename GT::Arc *parent_arc, long &curr_df, DynList< typename GT::Arc * > &bridges)
Computation of cut nodes (articulation points) of a graph.
void map_cut_graph(GT &cut_graph, DynDlist< typename GT::Arc * > &cross_arc_list)
Computes the mapped cut graph of a graph.
void map_subgraph(GT &sg, typename GT::Node *gsrc, const long &color)
GT::Node * create_and_map_node(typename GT::Node *gp, const long &color, GT &sg)
enum Aleph::Compute_Cut_Nodes::State state
void map_subgraph(GT &sg, const long &color)
Obtains a mapped copy of the component with the given color.
void operator()(DynDlist< typename GT::Node * > &list)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void paint_subgraph(typename GT::Node *p)
DynDlist< typename GT::Node * > * list_ptr
Compute_Cut_Nodes(const GT &g, SA __sa=SA())
Constructor for cut nodes calculator.
void compute_blocks(DynDlist< GT > &block_list, GT &cut_graph, DynDlist< typename GT::Arc * > &cross_arc_list)
Build mapped graphs around cut nodes.
void cut_nodes(typename GT::Node *start, DynDlist< typename GT::Node * > &list)
Computes the cut nodes.
long paint_subgraphs()
Paints the connected components around the cut nodes.
void cut_nodes(typename GT::Node *p, typename GT::Arc *a)
void paint_from_cut_node(typename GT::Node *p)
bool has_curr() const noexcept
Return true if the iterator has current item.
T & access(const size_t i) const noexcept
Fast access without checking allocation and bound_min_clock checking.
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
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.
Doubly-linked list (defined in tpl_dynList.H).
void next_ne() noexcept
Advances the iterator to the next filtered element (noexcept version).
Node * get_first_node() const
Return any node in the graph.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
NodeInfo & get_info() noexcept
Return a modifiable reference to the data contained in the node.
void reset_arcs() const
Reset all the arcs of graph (the control bits, the state, the counter and the cookie)
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.
static void map_arcs(A1 *p, A2 *q) noexcept
Map the arcs through their cookies.
void reset_counter_nodes() const noexcept
Reset all the counters to zero for all the nodes of graph.
void for_each_node(Operation &operation) const
Unconditionally traverse all the nodes of graph and on each one perform an operation.
void reset_counter_arcs() const noexcept
Reset all the counters to zero for all the arcs of graph.
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.
#define NODE_COUNTER(p)
Get the counter of a node.
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
#define ARC_BITS(p)
Return the control bits of arc p.
#define NODE_COOKIE(p)
Return the node cookie
void clear_graph(GT &g) noexcept
Clean a graph: all its nodes and arcs are removed and freed.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
#define IS_ARC_VISITED(p, bit)
Determine whether the bit field is or not set to one.
DynList< typename GT::Arc * > find_bridges(const GT &g, typename GT::Node *start, SA sa=SA())
Find all bridge edges in a connected undirected graph.
#define NODE_BITS(p)
Get the control bits of a node.
Main namespace for Aleph-w library functions.
const long Cross_Arc
Special marker for arcs connecting a cut node to a non-cut block.
and
Check uniqueness with explicit hash + equality functors.
static long & color(typename GT::Node *p)
Filtered iterator on all the arcs of a graph.
Filtered iterator of adjacent arcs of a node.
Utility algorithms and operations for graphs.