A Python utility for generating incremental, publication-quality visualizations of Branch and Bound search trees. This tool calculates optimal tree layouts and generates step-by-step frames showing the evolution of the optimization process, including node status changes (e.g., fractional, pruned, incumbent).
- Auto-Layout Engine: Automatically calculates horizontal and vertical spacing based on text length to prevent overlapping nodes.
- Incremental Reveal: Generates a sequence of images representing the "steps" of the algorithm.
- Status Tracking: Nodes change colors based on their state (Root, Fractional, Incumbent, Pruned, Infeasible) at each specific step.
- Symmetrical Framing: Maintains a consistent viewport across all frames for easy conversion into GIFs or videos.
The layout engine uses a non-local coordinate assignment:
- It assigns
$x$ -coordinates to leaf nodes first. - Parent nodes are then positioned at the mean
$x$ of their children, creating a clean, symmetrical branching aesthetic.
Refer to this file and this file for pretty complete examples.