CkPttn 1.2.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MidTree Class Reference

Tree data structure for mid-level Gray code algorithm. More...

#include <tree.hpp>

Public Member Functions

 MidTree (const MidVertex &x)
 Construct a MidTree from a MidVertex bitstring.
 
bool flip_tree ()
 Perform a flip-tree operation (tau transformation)
 
void rotate ()
 Rotate the tree to a canonical form.
 
void to_bitstring (int x[]) const
 Convert the tree to a bitstring representation.
 

Detailed Description

Tree data structure for mid-level Gray code algorithm.

Implements the Composite pattern: MidTree is a rooted tree in which every node can serve as the root of a subtree. The tree structure is realized by the children_ list (each node's child list) and the parent_ vector (each node's parent pointer).

Represents a rooted tree with children lists used in the middle-levels Gray code algorithm. Supports tree rotations, flip operations, and bitstring conversion for generating Hamiltonian cycles.

Constructor & Destructor Documentation

◆ MidTree()

MidTree::MidTree ( const MidVertex &  x)
explicit

Construct a MidTree from a MidVertex bitstring.

Parameters
[in]xThe input MidVertex

Member Function Documentation

◆ flip_tree()

bool MidTree::flip_tree ( )

Perform a flip-tree operation (tau transformation)

◆ rotate()

void MidTree::rotate ( )

Rotate the tree to a canonical form.

◆ to_bitstring()

void MidTree::to_bitstring ( int  x[]) const

Convert the tree to a bitstring representation.

Parameters
[out]xOutput bitstring array

The documentation for this class was generated from the following file: