Functions for testing if a graph represents a (free) tree or forest. More...
Classes | |
class | ogdf::LCA |
Implements the <O(n log n), O(1)>-time "sparse table" algorithm by Bender and Farach-Colton to compute lowest common ancestors (LCAs) in arborescences (not arbitrary directed acyclic graphs). More... | |
Methods for trees and forests | |
bool | ogdf::isTree (const Graph &G) |
Returns true iff G is a tree, i.e. contains no undirected cycle and is connected. More... | |
bool | ogdf::isArborescenceForest (const Graph &G, List< node > &roots) |
Returns true iff G is a forest consisting only of arborescences. More... | |
bool | ogdf::isArborescenceForest (const Graph &G) |
Returns true iff G is a forest consisting only of arborescences. More... | |
bool | ogdf::isArborescence (const Graph &G, node &root) |
Returns true iff G represents an arborescence. More... | |
bool | ogdf::isArborescence (const Graph &G) |
Returns true iff G represents an arborescence. More... | |
Functions for testing if a graph represents a (free) tree or forest.
|
inline |
Returns true iff G
represents an arborescence.
An arborescence is a digraph that has a unique node with indegree 0 (the root) such that, for any other vertex v, there is exactly one directed walk from r to v.
G | is the input graph. |
G
represents an arborescence, false otherwise. Definition at line 994 of file simple_graph_alg.h.
Returns true iff G
represents an arborescence.
An arborescence is a digraph that has a unique node with indegree 0 (the root) such that, for any other vertex v, there is exactly one directed walk from r to v.
G | is the input graph. |
root | is assigned the root node (if true is returned). |
G
represents an arborescence, false otherwise.
|
inline |
Returns true iff G
is a forest consisting only of arborescences.
An arborescence is a digraph that has a unique node with indegree 0 (the root) such that, for any other vertex v, there is exactly one directed walk from r to v.
G | is the input graph. |
G
represents an arborescence forest, false otherwise. Definition at line 950 of file simple_graph_alg.h.
Returns true iff G
is a forest consisting only of arborescences.
An arborescence is a digraph that has a unique node with indegree 0 (the root) such that, for any other vertex v, there is exactly one directed walk from r to v.
G | is the input graph. |
roots | is assigned the list of root nodes of the arborescences in the forest. If false is returned, roots is undefined. |
G
represents an arborescence forest, false otherwise.
|
inline |
Returns true iff G
is a tree, i.e. contains no undirected cycle and is connected.
G | is the input graph. |
G
is a tree, false otherwise. Definition at line 922 of file simple_graph_alg.h.