# Bayesian Networks, Markov Networks, Moralisation, Triangulation: a Categorical Perspective

arXiv: https://arxiv.org/abs/2512.09908 · HTML: https://mlsanity.com/paper/2512.09908/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 12 of its 27 references that are in the map.
- First posted on arXiv 10 Dec 2025.

## Builds on (most cited first, 12 of 12)

- [A synthetic approach to Markov kernels, conditional independence and theorems on sufficient statistics](https://mlsanity.com/paper/1908.07021/) (2019)
- [Category Theory in Machine Learning](https://mlsanity.com/paper/2106.07032/) (2021)
- [Causal Inference by String Diagram Surgery](https://mlsanity.com/paper/1811.08338/) (2018)
- [Causal models in string diagrams](https://mlsanity.com/paper/2304.07638/) (2023)
- [The d-separation criterion in Categorical Probability](https://mlsanity.com/paper/2207.05740/) (2022)
- [An Introduction to String Diagrams for Computer Scientists](https://mlsanity.com/paper/2305.08768/) (2023)
- [Hypergraph Categories](https://mlsanity.com/paper/1806.08304/) (2018)
- [Free gs-monoidal categories and free Markov categories](https://mlsanity.com/paper/2204.02284/) (2022)
- [The Logical Essentials of Bayesian Reasoning](https://mlsanity.com/paper/1804.01193/) (2018)
- [Interacting Hopf Algebras: the theory of linear systems](https://mlsanity.com/paper/1805.03032/) (2018)
- [Active Inference in String Diagrams: A Categorical Account of Predictive Processing and Free Energy](https://mlsanity.com/paper/2308.00861/) (2023)
- [An Algebraic Approach to Moralisation and Triangulation of Probabilistic Graphical Models](https://mlsanity.com/paper/2503.11820/) (2025)

## Abstract (arXiv)

Moralisation and Triangulation are transformations allowing to switch between different ways of factoring a probability distribution into a graphical model. Moralisation allows to view a Bayesian network (a directed model) as a Markov network (an undirected model), whereas triangulation addresses the opposite direction. We present a categorical framework where these transformations are modelled as functors between a category of Bayesian networks and one of Markov networks. The two kinds of network (the objects of these categories) are themselves represented as functors from a `syntax' domain to a `semantics' codomain. Notably, moralisation and triangulation can be defined inductively on such syntax via functor pre-composition. Moreover, while moralisation is fully syntactic, triangulation relies on semantics. This leads to a discussion of the variable elimination algorithm, reinterpreted here as a functor in its own right, that splits the triangulation procedure in two: one purely syntactic, the other purely semantic. This approach introduces a functorial perspective into the theory of probabilistic graphical models, which highlights the distinctions between syntactic and semantic modifications.
