|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Educational examples for converting graphs to tree structures. More...
#include <iostream>#include <tpl_graph.H>#include <tpl_tree_node.H>#include <graph_to_tree.H>#include <tpl_graph_utils.H>#include <generate_tree.H>Go to the source code of this file.
Functions | |
| template<typename T > | |
| void | print_tree (Tree_Node< T > *node, int depth=0) |
| template<typename T > | |
| void | delete_tree (Tree_Node< T > *node) |
| int | main () |
Educational examples for converting graphs to tree structures.
If your graph has cycles, you must first extract a spanning tree, then convert that spanning tree to Tree_Node format.
Built as part of Aleph-w examples, or manually with the library.
Definition in file graph_to_tree_example.cc.
Definition at line 61 of file graph_to_tree_example.cc.
References delete_tree(), Aleph::Tree_Node< T >::get_left_child(), Aleph::Tree_Node< T >::get_right_sibling(), and Aleph::next().
Referenced by delete_tree(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| int main | ( | ) |
Definition at line 77 of file graph_to_tree_example.cc.
References delete_tree(), GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::maps(), print_tree(), and root().
Definition at line 39 of file graph_to_tree_example.cc.
References Aleph::Tree_Node< T >::get_key(), Aleph::Tree_Node< T >::get_left_child(), Aleph::maps(), and print_tree().
Referenced by main(), and print_tree().