|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Illustrated tree DP + rerooting walkthrough. More...
#include <iostream>#include <iomanip>#include <array>#include <Tree_DP.H>#include <print_rule.H>Go to the source code of this file.
Typedefs | |
| using | G = List_Graph< Graph_Node< int >, Graph_Arc< int > > |
Functions | |
| int | main () |
| Example program demonstrating tree dynamic programming (DP) and rerooting DP. | |
Illustrated tree DP + rerooting walkthrough.
Definition in file tree_dp_example.cc.
| using G = List_Graph<Graph_Node<int>, Graph_Arc<int> > |
Definition at line 46 of file tree_dp_example.cc.
| int main | ( | ) |
Example program demonstrating tree dynamic programming (DP) and rerooting DP.
Builds a fixed rooted tree and demonstrates two types of DP:
Prints a formatted table of these per-node metrics.
Definition at line 60 of file tree_dp_example.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), nodes, Aleph::print_rule(), Aleph::tree_max_distance(), Aleph::tree_subtree_sizes(), Aleph::tree_sum_of_distances(), and Aleph::Gen_Tree_DP< GT, T, SA >::value().