Explicit Hopcroft's Trick in Categorical Partition Refinement
Takahiro Sanada, Ryota Kojima, Yuichi Komorida, Koko Muroya, Ichiro Hasuo
TL;DR
The paper tackles efficient, general partition refinement across diverse state-based systems by extracting the essence of Hopcroft's trick. It introduces Hopcroft's inequality for weighted rooted trees and a fibrational, functor-generic PR algorithm that explicitly builds a partition tree, enabling principled complexity analyses. By instantiating this framework to the EqRel $\to$ Set fibration, it yields three concrete, generator-friendly algorithms $\mathsf{fPR}^{\mathrm{H}\text{-}\mathbf{ER}}_{w_C}$, $\mathsf{fPR}^{\mathrm{H}\text{-}\mathbf{ER}}_{w_P}$, and $\mathsf{fPR}^{\mathrm{H}\text{-}\mathbf{ER}}_{w_R}$ with distinct weight schemes and provable complexity bounds. The approach unifies and extends existing coalgebraic PR methods, providing explicit data structures and amortised analyses that apply to DFAs, LTSs, Markov chains, and related systems, while offering tangible performance insights via illustrative runs.
Abstract
Algorithms for partition refinement are actively studied for a variety of systems, often with the optimisation called Hopcroft's trick. However, the low-level description of those algorithms in the literature often obscures the essence of Hopcroft's trick. Our contribution is twofold. Firstly, we present a novel formulation of Hopcroft's trick in terms of general trees with weights. This clean and explicit formulation -- we call it Hopcroft's inequality -- is crucially used in our second contribution, namely a general partition refinement algorithm that is functor-generic (i.e. it works for a variety of systems such as (non-)deterministic automata and Markov chains). Here we build on recent works on coalgebraic partition refinement but depart from them with the use of fibrations. In particular, our fibrational notion of $R$-partitioning exposes a concrete tree structure to which Hopcroft's inequality readily applies. It is notable that our fibrational framework accommodates such algorithmic analysis on the categorical level of abstraction.
