45#include <lal/detail/graphs/traversal.hpp>
59template <
class graph_t>
61 const auto n = g.get_num_nodes();
64 if (n <= 1) {
return true; }
67 if (g.get_num_edges() != n - 1) {
return false; }
Abstract graph Breadth-First Search traversal.
Definition: traversal.hpp:89
bool all_visited() const noexcept
Have all nodes been visited?
Definition: traversal.hpp:245
void start_at(node source) noexcept
Start traversal at a given node.
Definition: traversal.hpp:152
void set_use_rev_edges(bool use) noexcept
Set whether the traversal can use reversed edges.
Definition: traversal.hpp:173
bool is_graph_a_tree(const graph_t &g) noexcept
Is the input graph a tree?
Definition: is_tree.hpp:60
Main namespace of the library.
Definition: basic_types.hpp:50