39# ifndef TPL_TEST_ACYCLIQUE_H
40# define TPL_TEST_ACYCLIQUE_H
42# include <type_traits>
70 template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
92 std::optional<Frame> here(std::in_place, curr,
sa);
95 if (
auto tgt = here->template next_target<Test_Cycle, true>())
101 frames.
push(std::move(*here));
102 here.emplace(tgt,
sa);
113 Frame & f = frames.
top();
115 if (
auto tgt = f.template next_target<Test_Cycle, true>())
121 here.emplace(tgt,
sa);
134 <<
"is_graph_acyclique() does not work for digraphs";
144 for (
typename GT::Node_Iterator it(g); it.has_curr(); it.next_ne())
146 typename GT::Node *curr = it.get_current_node_ne();
232 template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
C++20 concepts for the protocol shared by graph algorithms.
Stack of the frames of a depth-first search that does not recurse.
T & push(Args &&...args)
Builds a frame on top of the stack.
bool is_empty() const noexcept
Whether the stack has no frames.
T & top() noexcept
The top frame; the stack must not be empty.
void pop() noexcept
Destroys the top frame; the stack must not be empty.
Determines whether a graph contains cycles.
Has_Cycle(SA &&__sa=SA())
bool operator()(GT &g) const
Invokes the cycle-existence test.
Determines whether a graph is acyclic (contains no cycles).
bool is_acyclique(typename GT::Node *curr)
Is_Graph_Acyclique(SA &&__sa=SA())
bool is_acyclique(GT &g, size_t num_arcs, bool num_arcs_known=true)
Is_Graph_Acyclique(SA &__sa)
bool operator()(GT &g, size_t num_arcs)
Invokes the acyclicity test, with the number of arcs that the filter shows.
A filter that an algorithm object keeps: one given as an lvalue is used where it is,...
void reset_bit_nodes(int bit) const noexcept
Reset bit to zero for all the nodes of graph.
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.
void reset_bit_arcs(int bit) const noexcept
Reset bit to zero for all the arcs of graph.
constexpr size_t get_num_arcs() const noexcept
Return the number of arcs of the graph.
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
#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.
The next arc of a node to look at, for a depth-first search that keeps only that in a frame.
Default filter for filtered iterators on arcs.
Stack of the frames of a depth-first search that does not recurse.
Utility algorithms and operations for graphs.