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; }
74 return bfs.all_visited();
Abstract graph Breadth-First Search traversal.
Definition traversal.hpp:89
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:48