Compositional Algorithms with Sheaves

A hard problem on a large structure is often easy on its pieces. Tree decompositions are the classical version of that observation: cut a graph into small overlapping bags arranged in a tree, solve the problem on each bag, and glue the answers back together with dynamic programming. The trouble is that every new kind of data – hypergraphs, databases, Petri nets, simplicial complexes – needs the whole argument built again from scratch.
This project asks the question one level up. Structured decompositions state what a decomposition is for any suitable category of data, and sheaves state what it means for local answers to glue. Together they say which problems can be decided by working locally, over any of those kinds of data at once – and, in the cases where the gluing fails, they give a way to measure the failure rather than merely observe it.
Project team
How the papers fit together
Benjamin Merlin Bumpus led this project and James Fairbanks is an author on the papers below, so each entry names the rest of the collaborators.
Compositional algorithms on compositional data: deciding sheaves on presheaves, with Ernst Althaus of Johannes Gutenberg University Mainz and Daniel Rosiak, is the theorem the project is built around: structured decompositions induce Grothendieck topologies, and any problem that is a sheaf for one of them is decidable in linear time on inputs of bounded width. It is the folklore about dynamic programming on tree decompositions, made general and made precise.
Lassos: pushing tree decompositions forward along homomorphisms, with Will J. Turner, settles which maps a decomposition can be carried along: contractions are, up to isomorphism, the only surjections that preserve both a tree decomposition and the shape of its tree. The proof gets there by way of the lasso, which is what a contraction becomes in any category with pushouts of monomorphisms, and that is what carries the result off graphs and onto the other kinds of data above.
Two papers take up the failures. How nice is this functor? Two squares and some homology go a long way, with Fabrizio Genovese, Caterina Puca and Daniel Rosiak, introduces lavish presheaves – existence without uniqueness – so that compositionality becomes a quantity rather than a property. Algorithmic and extremal obstructions through the language of cohomology, with Anny Beatriz Azevedo, Matteo Capucci and Daniel Rosiak, then uses Cech cohomology to say exactly how local solutions fail to patch, recovering Koenig’s theorem in cohomological terms along the way.
Towards a unified theory of time-varying data, with Wilmer Leal, Martti Karvonen and Frederic Simard, applies the same machinery to time: a temporal object is a sheaf on a poset of time intervals, and the many incompatible definitions of a time-varying graph become instances of one construction.
Software
- StructuredDecompositions.jl – docs – decompositions and the algorithms that run on them.
- CliqueTrees.jl – docs – tree decompositions and chordal completions, written by Richard Samuelson; it is a dependency of packages across the Julia ecosystem, and the sparse factorization the coordination work solves with.
Written elsewhere
Benjamin Merlin Bumpus writes about this work on Merlin’s Notebook: Towards a unified theory of time-varying data introduces the temporal paper in his own words, and learn about dynamic programming with category theory is the short version of the decomposition results.
Richard Samuelson’s Tree decompositions in Julia on the AlgebraicJulia blog is the practical companion: what a tree decomposition is, and the dozen-odd algorithms CliqueTrees.jl offers for finding one.
For background from outside the lab, Emilio Minichiello has written a series of blog posts working up to structured decompositions from categories of graphs, for readers who want the category theory built from the ground.
Project articles
Where an entry carries a note, it says what the paper establishes and what to read it for.
- Bumpus, B. M., Leal, W., Fairbanks, J. P., Karvonen, M., & Simard, F. (2026). Towards a Unified Theory of Time-Varying Data. Applied Categorical Structures, 34(3), 23. https://doi.org/10.1007/s10485-026-09860-4
A general theory of data that changes over time, built as sheaves on posets of time intervals – categories of narratives. It defines both temporal objects and their morphisms, distinguishes cumulative from persistent readings and moves between them, lifts static notions to temporal ones systematically, works for any category with limits and colimits, and connects to dynamical systems. Time-varying graphs have been reinvented repeatedly with incompatible definitions. This is the lab’s answer to what all of them are instances of, and the sheaf-theoretic machinery is the same as the rest of the project.
Read it for The five desiderata in the introduction, then the definition of a narrative. The comparisons to existing temporal graph formalisms can be sampled.
- Azevedo, A. B., Bumpus, B. M., Capucci, M., Fairbanks, J. P., & Rosiak, D. (2025). Algorithmic and Extremal Obstructions Through the Language of Cohomology. arXiv. https://doi.org/10.48550/arXiv.2407.03488
A problem becomes a presheaf assigning certificates to instances, and Cech cohomology of that presheaf measures exactly how local solutions fail to patch into global ones. Applied to Vertex Cover, Cycle Cover and Odd Cycle Transversal, the obstructions show up as concrete phenomena – hidden cycles, local solutions that inflate – and classical results such as Koenig’s theorem are recovered in cohomological terms. The compositional algorithms only work when local answers glue. This is the project’s account of what is happening when they do not, which is the more common case.
Read it for The cohomological reading of Koenig’s theorem, which is where the machinery first pays for itself.
Read first Compositional Algorithms on Compositional Data: Deciding Sheaves on Presheaves
- Bumpus, B. M., Fairbanks, J. P., & Turner, W. J. (2024). Lassos: Pushing Tree Decompositions Forward Along Homomorphisms. arXiv. https://doi.org/10.48550/arXiv.2408.15184
Treewidth is monotone under subgraphs and contractions; the paper shows that contractions are, up to isomorphism, the only surjective graph homomorphisms that preserve tree decompositions and the shape of the decomposition tree. It proves this by introducing the lasso, which is what a contraction becomes in an arbitrary category with pushouts of monomorphisms, so that the same question can be asked of directed multigraphs, hypergraphs, Petri nets, databases, simplicial sets and the rest. Decompositions are the lab’s tool for turning a hard global problem into local ones, and this settles which maps between structures a decomposition can be carried along.
Read it for The characterization theorem, then the lasso, which the authors flag as of independent interest and which is what carries the result beyond graphs.
- Bumpus, B. M., Fairbanks, J. P., Genovese, F., Puca, C., & Rosiak, D. (2024). How nice is this functor? Two squares and some homology go a long way. Proceedings of Applied Category Theory, 2024.
A way to ask how badly a functor fails to be compositional, and what can be done about it. The paper introduces lavish presheaves – presheaves satisfying the existence half of the sheaf condition but not uniqueness – as the setting in which such failures can be measured rather than merely observed. Compositionality is usually presented as a property a construction either has or lacks. The sheaves project needs it to be a quantity, because the interesting structures are the ones that almost have it.
Read it for The definition of a lavish presheaf and the two squares of the title.
- Althaus, E., Bumpus, B. M., Fairbanks, J. P., & Rosiak, D. (2023). Compositional Algorithms on Compositional Data: Deciding Sheaves on Presheaves. arXiv. https://doi.org/10.48550/arXiv.2302.05575
The folklore that dynamic programming is the right approach on compositionally structured graphs, made general and made precise. Structured decompositions define Grothendieck topologies on adhesive categories of data, and any problem expressible as a sheaf for one of those topologies can be decided in linear time on inputs of bounded decomposition width whose decomposition shapes have bounded feedback vertex number. This is the theorem the sheaves project is organized around: it says which problems the compositional algorithms apply to, and it applies to any C-set category, so the same statement covers graphs, hypergraphs, databases and simplicial complexes at once.
Read it for The topology construction and the main theorem. The catalogue of structures it specializes to is worth a skim to see how wide the result is.
Sponsors
Computational sheaf theory has been supported by the DARPA program Automating Scientific Knowledge Extraction and Modeling.