Functions for testing if a graph represents a (free) tree or forest.
More...
|
| 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...
|
| |
Functions for testing if a graph represents a (free) tree or forest.
◆ isArborescence() [1/2]
| bool ogdf::isArborescence |
( |
const Graph & |
G, |
|
|
node & |
root |
|
) |
| |
Returns true iff G represents a tree.
- Parameters
-
| G | is the input graph. |
| root | is assigned the root node (if true is returned). |
- Returns
- true if
G represents a tree, false otherwise.
◆ isArborescence() [2/2]
| bool ogdf::isArborescence |
( |
const Graph & |
G | ) |
|
|
inline |
Returns true iff G represents an arborescence.
- Parameters
-
- Returns
- true if
G represents a arborescence, false otherwise.
Definition at line 925 of file simple_graph_alg.h.
◆ isForest() [1/2]
Returns true iff G represents a forest, i.e., a collection of arborescences.
- Parameters
-
| 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. |
- Returns
- true if
G represents a forest, false otherwise.
◆ isForest() [2/2]
| bool ogdf::isForest |
( |
const Graph & |
G | ) |
|
|
inline |
Returns true iff G represents a forest, i.e. a collection of arborescences.
- Parameters
-
- Returns
- true if
G represents a forest, false otherwise.
Definition at line 900 of file simple_graph_alg.h.
◆ isFreeForest()
| bool ogdf::isFreeForest |
( |
const Graph & |
G | ) |
|
Returns true iff G is a forest, i.e. contains no undirected cycle.
- Parameters
-
- Returns
- true if
G contains no undirected cycle, false otherwise.
◆ isTree()
| bool ogdf::isTree |
( |
const Graph & |
G | ) |
|
|
inline |
Returns true iff G is a tree, i.e. contains no undirected cycle and is connected.
- Parameters
-
- Returns
- true if
G is a tree, false otherwise.
Definition at line 875 of file simple_graph_alg.h.