---
title: Path-Consistency Algorithm Overview
url: https://www.emergentmind.com/topics/path-consistency-algorithm-pca
type: topic
---

# Path-Consistency Algorithm Overview

The path-consistency algorithm (PCA) is a fundamental local consistency technique in constraint satisfaction, particularly within binary constraint networks (BCNs). Path-consistency (PC) refines the global structure of a constraint network by ensuring that the allowed assignments for every pair of variables can be consistently extended to every third variable. Directional path-consistency (DPC) is a refinement of PC that leverages an imposed variable ordering to enable more efficient enforcement. The DPC family of algorithms, including DPC* for majority-closed constraint languages, play a decisive role in the tractability of numerous CSP subclasses and underlie efficient, backtrack-free solving in domains such as geometric reasoning, temporal reasoning, and scene labeling [1708.05522].

## 1. Formal Definition and Classical Path-Consistency

Let $\mathcal{N} = (V, D, C)$ be a binary constraint network (BCN) with variables $V = \{v_1, ..., v_n\}$, finite domains $D = \{D_1, ..., D_n\}$, and binary constraints $C = \{(v_i, v_j, R_{ij})\}$. The constraint graph $G = (V, E)$ contains an edge $\{v_i, v_j\}$ iff $R_{ij} \in C$.

A network is **path-consistent (PC)** if, for every triple $(v_i, v_k, v_j)$ where $\{v_i, v_j\} \in E$, and for every pair $(a,c) \in R_{ij}$, there exists $b \in D_k$ such that $(a, b) \in R_{ik}$ and $(b, c) \in R_{kj}$. PC is enforced iteratively, updating relations to maintain this property. The canonical PC-3 algorithm maintains a queue of such triples, propagating constraint refinements until closure or inconsistency. The worst-case time complexity is $O(n^3 d^3)$ for $n$ variables, with $d = \max |D_i|$ [1708.05522].

## 2. Directional Path-Consistency (DPC) and Enforcement

Directional path-consistency (DPC), as proposed by Dechter and Pearl, exploits a total ordering $\prec$ on $V$ (e.g., $v_1 \prec v_2 \prec \dots \prec v_n$). Three notions are introduced:

- **Directionally arc-consistent (DAC):** For every arc $(i, k)$ with $i \prec k$, every $a \in D_i$ has some $b \in D_k$ with $(a, b) \in R_{ik}$.
- **DPC:** For every edge $(i, j)$ and every $k$ with $i \prec k$ and $j \prec k$, the triple $(i, k, j)$ is PC.
- **Strong DPC:** Both DAC and DPC hold throughout the network.

Strong DPC is enforceable in a single backward pass via Algorithm 1 (strong-DPC): for $k = n$ down to $1$, first enforce DAC for each $i < k$, then, for each $i, j < k$ with $R_{ik}, R_{jk} \in C$, enforce PC via the update $R_{ij} \leftarrow R_{ij} \cap (R_{ik} \circ R_{kj})$. The time complexity is $\Theta(e \cdot w^*(\prec) \cdot d^2)$, with $w^*(\prec)$ the induced width along ordering $\prec$ [1708.05522].

## 3. Decidability Conditions: Variable Elimination Property and the Helly Property

DPC decides the CSP for a constraint language $\Gamma$ if and only if $\Gamma$ possesses the **variable elimination property (VEP)**: for every variable $x$, any solution of the projected network $\mathcal{N}_{-x}$ (where $x$ is eliminated) can be extended to a solution to the full network. The structural characterization is formalized as:

**Theorem 3.1:** For a complete set of binary relations $\Gamma$, strong-DPC decides CSP$(\Gamma)$ if and only if $\Gamma$ has VEP [1708.05522].

VEP is linked to the **Helly property** for binary relations: for any collection $R_1, ..., R_k \subseteq D \times E$, a common intersection exists for all $R_i(a_i) \neq \emptyset$ whenever every pairwise intersection is nonempty.

A key consequence is that no complete VEP constraint language admits domains of size greater than 2, constraining the scope of DPC's direct applicability [1708.05522].

## 4. The DPC* Algorithm for Majority-Closed Constraint Languages

Many tractable BCN classes, such as connected row-convex (CRC) and tree-preserving constraints, are **majority-closed** (admit a majority polymorphism) but do not satisfy VEP when $|D| \geq 3$. DPC* adapts the strong-DPC algorithm by weakening DAC enforcement:

Let $\phi = \{\phi_1, ..., \phi_n\}$ be a multi-sorted majority operation satisfying $\phi_i(a,a,b) = \phi_i(a,b,a) = \phi_i(b,a,a) = a$ $\forall a,b$. $R \subseteq D_i \times D_j$ is closed under $\phi$ iff $\forall t_1, t_2, t_3 \in R$, $\phi(t_1, t_2, t_3) \in R$. $\Gamma$ is majority-closed if some $\phi$ preserves every $R \in \Gamma$.

**Algorithm 2 (DPC*):**  
For each variable in reverse order:

- If $v_k$ has only one later neighbor $i$, apply one-sided arc-consistency: $D_i \leftarrow D_i \cap R_{ki}(D_k)$.
- Otherwise, for each $i < k$: $D_k \leftarrow D_k \cap R_{ik}(D_i)$.
- For each $i < k$, $j < i$: $R_{ij} \leftarrow R_{ij} \cap (R_{ik} \circ R_{kj})$.

**Theorem 4.1:** If $\Gamma$ is a complete majority-closed language, DPC* decides CSP$(\Gamma)$ and produces a decomposable network: any partial solution can be extended to a global solution without backtracking [1708.05522].

## 5. Notable Majority-Closed Classes and Applications

Two prominent majority-closed BCN classes are:

- **Connected Row-Convex (CRC) Constraints:** Domains are chains (totally ordered sets), with allowed sets projecting to row-convex sets in the other domain. CRC constraints are employed in temporal reasoning, geometric reasoning, and logical filtering [1708.05522].
- **Tree-Preserving Constraints:** Domains are trees, and each $R$ preserves connectivity of subtrees. These constraints are instrumental in scene labeling problems in vision, map labeling, and spatial reasoning [1708.05522].

Applications of these classes often require efficient, backtrack-free CSP solving, a property guaranteed in majority-closed languages via DPC*.

## 6. Empirical Comparison and Performance Analysis

Empirical evaluations compared DPC* with two state-of-the-art local consistency solvers:

- **PC2001:** An optimized PC algorithm [Bessière et al. ’05].
- **SAC3-SDS:** A singleton arc-consistency solver [Bessière–Debruyne ’11].

Tested on tree-preserving and random majority-closed networks (domain size $d=100$, density $\rho=0.5$, looseness $\ell=0.3$), DPC* demonstrated the following results [1708.05522]:

| $n$ (variables) | PC2001 time | SAC3-SDS time | DPC* time |
|-----------------|-------------|---------------|-----------|
| 20              | 76 s        | 52 s          | 16 s      |
| 60              | 211 s       | 120 s         | 28 s      |
| 120             | 323 s       | 230 s         | 65 s      |

DPC* scales linearly in $n$, achieves $5$–$7\times$ speedups over PC2001 and $3$–$4\times$ over SAC3-SDS, and remains $O(d)$ in domain size while others scale as $O(d^2)$–$O(d^3)$. Performance is stable across varying density and looseness, attributed to single-pass elimination and majority-driven decomposability.

## 7. Summary and Context

The path-consistency algorithm and its directional variants, particularly DPC*, form an essential component for the efficient resolution of CSPs in both theoretical and applied settings. Decidability by DPC depends on the VEP, while majority-closed languages—encompassing key domains in temporal, spatial, and logical reasoning—are decisively solvable by the DPC* algorithm, yielding decomposability and empirical speed advantages. This situates DPC and DPC* as central algorithmic tools for constraint-based inference where structure and polymorphism properties can be exploited [1708.05522].

Source: https://www.emergentmind.com/topics/path-consistency-algorithm-pca