LAL: Linear Arrangement Library 23.01.00
A library focused on algorithms on linear arrangements of graphs.
|
Namespace for the graphs data structures. More...
Classes | |
class | directed_graph |
Directed graph class. More... | |
class | free_tree |
Free tree graph class. More... | |
class | graph |
Abstract class for graphs. More... | |
class | rooted_tree |
Rooted tree graph class. More... | |
class | tree |
Tree graph class. More... | |
class | undirected_graph |
Undirected graph class. More... | |
Enumerations | |
enum class | tree_type { empty , singleton , caterpillar , linear , spider , two_linear , star , quasistar , bistar , unknown } |
Enumeration of several types of trees. More... | |
Functions | |
std::pair< free_tree, node > | from_head_vector_to_free_tree (const head_vector &hv, bool normalise=true, bool check=true) noexcept |
Converts a head vector into a rooted tree. More... | |
rooted_tree | from_head_vector_to_rooted_tree (const head_vector &hv, bool normalise=true, bool check=true) noexcept |
Converts a head vector into a rooted tree. More... | |
rooted_tree | from_edge_list_to_rooted_tree (const std::vector< edge > &edge_list, bool normalise=true, bool check=true) noexcept |
Converts an edge list into a rooted tree. More... | |
free_tree | from_edge_list_to_free_tree (const std::vector< edge > &edge_list, bool normalise=true, bool check=true) noexcept |
Converts an edge list into a rooted tree. More... | |
directed_graph | from_edge_list_to_directed_graph (const std::vector< edge > &edge_list, bool normalise=true, bool check=true) noexcept |
Converts an edge list into a directed graph. More... | |
undirected_graph | from_edge_list_to_undirected_graph (const std::vector< edge > &edge_list, bool normalise=true, bool check=true) noexcept |
Converts an edge list into an undirected graph. More... | |
std::ostream & | operator<< (std::ostream &os, const undirected_graph &g) |
Standard output operator for undirected graphs. More... | |
std::ostream & | operator<< (std::ostream &os, const directed_graph &g) |
Standard output operator for directed graphs. More... | |
std::ostream & | operator<< (std::ostream &os, const rooted_tree &g) |
Standard output operator for directed rooted trees. More... | |
Variables | |
constexpr std::size_t | __tree_type_size |
Number of elements within enumeration lal::graphs::tree_type. | |
Namespace for the graphs data structures.
This namespace contains the data structures that implement graphs. Note that, although we do not support labelled graphs, the nodes of these graphs carry a label, a number between \(0\) and \(n-1\), where \(n\) is the number of nodes of the graph. The functions (in other namespaces) that return a lal::node will always use a value greater than or equal to \(n\) to denote that the node index is invalid.
See the concepts in Graph Theory page of this documentation for further details.
|
strong |
Enumeration of several types of trees.
Classifies a tree into not necessarily disjoint classes of trees.
The description of each class can be found in The different types of trees.
|
noexcept |
Converts an edge list into a directed graph.
An edge list is a list of pairs of indices, each index in the pair being different and in \([0,n-1]\)., where \(n\) is the number of vertices of the tree.
Methods lal::io::read_edge_list read an edge list from a file in disk.
edge_list | An edge list. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
noexcept |
Converts an edge list into a rooted tree.
An edge list is a list of pairs of indices, each index in the pair being different and in \([0,n-1]\)., where \(n\) is the number of vertices of the tree.
Methods lal::io::read_edge_list read an edge list from a file in disk.
edge_list | An edge list. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
noexcept |
Converts an edge list into a rooted tree.
An edge list is a list of pairs of indices, each index in the pair being different and in \([0,n-1]\)., where \(n\) is the number of vertices of the tree.
Methods lal::io::read_edge_list read an edge list from a file in disk.
edge_list | An edge list. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
noexcept |
Converts an edge list into an undirected graph.
An edge list is a list of pairs of indices, each index in the pair being different and in \([0,n-1]\)., where \(n\) is the number of vertices of the tree.
Methods lal::io::read_edge_list read an edge list from a file in disk.
edge_list | An edge list. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
noexcept |
Converts a head vector into a rooted tree.
A head vector of an n-vertex tree is a list of non-negative integer numbers. The number at position i denotes the parent node of the vertex at said position. Value '0' denotes the root. In this case, the vertex corresponding to the value '0' is not labelled as a root.
Each tree is formatted as a list of whole, positive numbers (including zero), each representing a node of the tree. The number 0 denotes the root of the tree, and a number at a certain position indicates its parent node. For example, when number 4 is at position 9 it means that node 9 has parent node 4. Therefore, if number 0 is at position 1 it means that node 1 is the root of the tree. A complete example of such a tree's representation is the following
0 3 4 1 6 3
which should be interpreted as
(a) predecessor: 0 3 4 1 6 3 (b) node of the tree: 1 2 3 4 5 6
Note that lines like these are not valid:
(1) 0 2 2 2 2 2 (2) 2 0 0
Line (1) is not valid due to a self-reference in the second position, and (2) is not valid since it contains two '0' (i.e., two roots).
Methods lal::io::read_head_vector read a head vector from a file in disk.
hv | A head vector as specified above. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
noexcept |
Converts a head vector into a rooted tree.
A head vector of an n-vertex tree is a list of non-negative integer numbers. The number at position i denotes the parent node of the vertex at said position. Value '0' denotes the root. In this case, the vertex corresponding to the value '0' is not labelled as a root.
Each tree is formatted as a list of whole, positive numbers (including zero), each representing a node of the tree. The number 0 denotes the root of the tree, and a number at a certain position indicates its parent node. For example, when number 4 is at position 9 it means that node 9 has parent node 4. Therefore, if number 0 is at position 1 it means that node 1 is the root of the tree. A complete example of such a tree's representation is the following
0 3 4 1 6 3
which should be interpreted as
(a) predecessor: 0 3 4 1 6 3 (b) node of the tree: 1 2 3 4 5 6
Note that lines like these are not valid:
(1) 0 2 2 2 2 2 (2) 2 0 0
Line (1) is not valid due to a self-reference in the second position, and (2) is not valid since it contains two '0' (i.e., two roots).
Methods lal::io::read_head_vector read a head vector from a file in disk.
hv | A head vector as specified above. |
normalise | Should the graph be normalised? |
check | In case the graph is not to be normalised, should we check whether it is nor not? |
|
inline |
Standard output operator for directed graphs.
Usable only by lal::graphs::directed_graph.
os | ostream C++ object. |
g | Input graph. |
|
inline |
Standard output operator for directed rooted trees.
Usable by lal::graphs::rooted_tree.
os | ostream C++ object. |
g | Input graph. |
|
inline |
Standard output operator for undirected graphs.
Usable by lal::graphs::undirected_graph, lal::graphs::free_tree.
os | ostream C++ object. |
g | Input graph. |