Forest

class Forest

Defined in forest.hpp.

This class represents the collection of spanning trees of the strongly connected components of a digraph.

Type aliases

label_type

Alias for the type of edge labels in a forest.

node_type

Alias for the type of nodes in a forest.

Constructors

Forest(Forest const&) = default

Default copy constructor.

Forest(Forest&&) = default

Default move constructor.

Forest(size_t)

Constructs a forest with n nodes.

operator=(Forest const&) = default

Default copy assignment constructor.

operator=(Forest&&) = default

Default move assignment constructor.

Modifiers

add_nodes(size_t)

Add nodes to the Forest .

clear() noexcept

Removes all nodes from the forest.

set(node_type, node_type, label_type)

Set the parent and edge label for a node.

Accessors

label(node_type) const

Returns the label of the edge from a node to its parent.

number_of_nodes() const noexcept

Returns the number of nodes in the forest.

parent(node_type) const

Returns the parent of a node.

Iterators

cbegin_parent() const noexcept

Returns an iterator pointing to the parent of the first node.

cend_parent() const noexcept

Returns an iterator pointing one-past the parent of the last node.