9#ifndef CKPTTN_MIDLEVEL_TREE_HPP
10#define CKPTTN_MIDLEVEL_TREE_HPP
49 std::vector<std::list<int>> children_;
50 std::vector<int> parent_;
53 int num_children(
int u)
const;
54 int ith_child(
int u,
int i)
const;
55 bool is_tau_preimage()
const;
56 bool is_tau_image()
const;
59 void move_leaf(
int leaf,
int new_parent,
int pos);
60 void rotate_to_vertex(
int u);
61 void rotate_children();
62 void rotate_children(
int k);
63 void root_canonically();
64 void compute_center(
int& c1,
int& c2)
const;
65 bool is_flip_tree_tau();
67 bool is_light_dumbbell()
const;
68 bool is_thin_leaf(
int u)
const;
69 bool has_thin_leaf()
const;
70 int count_pending_edges(
int u)
const;
71 void to_bitstring_rec(
int x[],
int u,
int& pos)
const;
72 int min_string_rotation(
int x[],
int length);
Tree data structure for mid-level Gray code algorithm.
Definition tree.hpp:29
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.