cs.CLMar 29, 2026

A gentle tutorial on Bock's algorithm for minimum directed spanning trees with a structured reformulation

Authors: Yuxi Wang, Jungyeul Park

Organizations: UBC, Canada · KAIST, South Korea

Abstract

Bock's 1971 algorithm is an exact primal--dual method for the minimum-cost arborescence problem, but its Algol presentation obscures the interaction of its maintained arrays and label-directed control flow. We provide a self-contained tutorial comprising the original listing, a line-mapped explanation, a circuit-forming three-node example, and a complete trace of Bock's ten-node instance. We also present a structured reformulation that replaces temporary span-label changes with explicit component and trace state. Local tightness and contraction-progress results, together with an operational-correspondence theorem, establish that the reformulation preserves Bock's candidate choices, transfers, and final solution.

Figures & tables

Explore similar work

Feb 27, 2026

Better Learning-Augmented Spanning Tree Algorithms via Metric Forest Completion

We present improved learning-augmented algorithms for finding an approximate minimum spanning tree (MST) for points in an arbitrary metric space. Our work follows a recent framework called metric forest completion (MFC), where the learned input is a forest that must be given additional edges to form a full spanning tree. Veldt et al. (2025) showed that optimally completing the forest takes Ω(n2)Ω(n^2) time, but designed a 2.62-approximation for MFC with subquadratic complexity. The same method is a (2γ+1)(2γ+ 1)-approximation for the original MST problem, where γ≥1γ\geq 1 is a quality parameter for the initial forest. We introduce a generalized method that interpolates between this prior algorithm and an optimal Ω(n2)Ω(n^2)-time MFC algorithm. Our approach considers only edges incident to a growing number of strategically chosen ``representative'' points. One corollary of our analysis is to improve the approximation factor of the previous algorithm from 2.62 for MFC and (2γ+1)(2γ+1) for metric MST to 2 and 2γ2γ respectively. We prove this is tight for worst-case instances, but we still obtain better instance-specific approximations using our generalized method. We complement our theoretical results with a thorough experimental evaluation.
May 13, 2026

Fast and Compact Graph Cuts for the Boykov-Kolmogorov Algorithm

Computing a minimum ss-tt cut in a graph is a solution to a wide range of computer vision problems and is often done using the Boykov-Kolmogorov (BK) algorithm. In this paper, we revisit the BK algorithm from both a theoretical and practical point of view. We improve the analysis of the time complexity of the BK algorithm to O(mn∣C∣)O(mn|C|) and propose a new algorithm, the fast BK (fBK) algorithm, with a time complexity of O(m∣C∣)O(m|C|), where mm, nn, and ∣C∣|C| are the number of edges, the number of vertices, and the capacity of the cut, respectively. We additionally propose a compact graph representation that allows our implementations of the BK and fBK algorithms to find a minimum ss-tt cut in a graph with up to 10910^9 vertices and 101010^{10} edges on a machine with 128 GB of memory. We denote these as cBK\texttt{cBK} and fcBK\texttt{fcBK}, respectively. Despite fcBK\texttt{fcBK} having the better worst-case guarantee, we find cBK\texttt{cBK} to be the fastest available implementation within the family of BK algorithms when evaluating on a comprehensive set of benchmark datasets, highlighting the importance of memory-efficient implementations. We make our implementations publicly available for further research and implementation development within minimum ss-tt cut algorithms.
Aug 12, 2026

Chain-of-Thought Shows the Path to a Tree: Realizing Branching Complexity

Chain of Thought (CoT) lifts the expressive ceiling of bounded-depth Transformers, with characterizations tying the number of CoT steps to circuit complexity classes. What remains largely missing are concrete instantiations with explicit, depth-bounded constructions, and the traversal procedures such characterizations presuppose. We close this gap for branching complexity. We give CoT realizations of depth-first search (DFS) and of Dijkstra algorithm, the latter subsuming breadth-first search, by unique hard-attention decoders of at most two layers, and use them as a shared computational substrate: reusing the DFS decoder yields the Strahler number of an nn-vertex tree in 2n−12n-1 steps with four layers, and reusing the Dijkstra decoder yields its width in n−1n-1 steps with three. Since computing the Strahler number of a binary tree given as a term is NC\textsuperscript{1}-complete, and our constructions handle arbitrary nn-ary trees without layer normalization or positional encodings, this is a non-trivial witness for the linear-step regime of the CoT hierarchy. Exploiting the classical bijection between ordered trees and Dyck paths, itself realized by our DFS construction, which emits the path as it traverses, we give independent constructions for both measures on the path representation.