87# ifndef TPL_CUT_NODES_H
88# define TPL_CUT_NODES_H
150 template <
class GT,
class SA = Dft_Show_Arc<GT>>
170 auto arc = i.get_curr();
174 auto tgt = i.get_tgt_node();
239 auto tgt = it.get_tgt_node();
243 auto arc = it.get_curr();
273 auto arc = it.get_curr();
277 auto tgt = it.get_tgt_node();
293 auto arc = it.get_curr();
297 auto tgt_node = it.get_tgt_node();
341 auto garc = i.get_curr();
347 auto gtgt = i.get_tgt_node();
433 <<
"Cut nodes have not been computed or the class is in another phase";
467 for (
typename GT::Node_Iterator it(*
gptr); it.has_curr(); it.next_ne())
469 first = it.get_curr();
471 if (first ==
nullptr)
515 auto gp = it.get_curr();
529 auto garc = it.get_curr();
542 assert(src !=
nullptr and tgt !=
nullptr);
589 for (
typename GT::Node_Iterator it(*
gptr); it.has_curr(); it.next_ne())
591 auto p = it.get_curr();
651 template <
class GT,
class SA = Dft_Show_Arc<GT>>
665 auto arc = it.get_curr();
666 if (arc == parent_arc)
669 auto tgt = it.get_tgt_node();
805 template <
class GT,
class SA = Dft_Show_Arc<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.
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.
Dynamic singly linked list with functional programming support.
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 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.
void for_each_node(Operation &operation) const
Unconditionally traverse all the nodes of graph and on each one perform an operation.
#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.
#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.
and
Check uniqueness with explicit hash + equality functors.
const long Cross_Arc
Special marker for arcs connecting a cut node to a non-cut block.
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.
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.