9#ifndef CKPTTN_MIDLEVEL_TREE_HPP
10#define CKPTTN_MIDLEVEL_TREE_HPP
44 std::vector<std::list<int>> children_;
45 std::vector<int> parent_;
48 int num_children(
int u)
const;
49 int ith_child(
int u,
int i)
const;
50 bool is_tau_preimage()
const;
51 bool is_tau_image()
const;
54 void move_leaf(
int leaf,
int new_parent,
int pos);
55 void rotate_to_vertex(
int u);
56 void rotate_children();
57 void rotate_children(
int k);
58 void root_canonically();
59 void compute_center(
int& c1,
int& c2)
const;
60 bool is_flip_tree_tau();
62 bool is_light_dumbbell()
const;
63 bool is_thin_leaf(
int u)
const;
64 bool has_thin_leaf()
const;
65 int count_pending_edges(
int u)
const;
66 void to_bitstring_rec(
int x[],
int u,
int& pos)
const;
67 int min_string_rotation(
int x[],
int length);
Tree data structure for mid-level Gray code algorithm.
Definition tree.hpp:24
void rotate()
Rotate the tree to a canonical form.
MidTree(const MidVertex &x)
Construct a MidTree from a MidVertex bitstring.
bool flip_tree()
Perform a flip-tree operation (tau transformation)
void to_bitstring(int x[]) const
Convert the tree to a bitstring representation.
Bitstring vertex for middle-levels Gray code algorithm.
Definition vertex.hpp:24
Bitstring vertex representation for middle-levels Gray code.