Skip to content

[Model] LengthBoundedDisjointPaths #298

Description

@isPANN

name: Problem
about: Propose a new problem type
title: "[Model] LengthBoundedDisjointPaths"
labels: model
assignees: ''

Motivation

LENGTH-BOUNDED DISJOINT PATHS from Garey & Johnson, A2 ND41. A classical NP-complete problem useful for reductions. It models the routing problem where multiple connections must share a network between the same source-sink pair, with quality-of-service constraints on path length. Applications include telecommunications routing and VLSI design.

Associated reduction rules:

  • As source: None found in current rule set.
  • As target: R62 (3SAT to LENGTH-BOUNDED DISJOINT PATHS)

Definition

Name: LengthBoundedDisjointPaths
Canonical name: Length-Bounded Disjoint Paths (also: Length-Constrained Vertex-Disjoint Paths)
Reference: Garey & Johnson, Computers and Intractability, A2 ND41

Mathematical definition:

INSTANCE: Graph G = (V,E), specified vertices s and t, positive integers J,K <= |V|.
QUESTION: Does G contain J or more mutually vertex-disjoint paths from s to t, none involving more than K edges?

Variables

  • Count: J * |V| binary variables. For each of J path slots and each vertex v, a binary variable x_{j,v} indicates whether vertex v is on path j.
  • Per-variable domain: binary {0, 1}.
  • dims() specification: vec![2; num_paths_required * num_vertices] — J * |V| binary variables, laid out as path 0's vertices first, then path 1's vertices, etc.
  • Meaning: The variable assignment encodes J candidate paths from s to t. For each path slot j (0 <= j < J), the selected vertices must form a simple s-t path of at most K edges in G. The paths must be vertex-disjoint at internal vertices (s and t are shared). The metric is bool: True if the encoded paths satisfy all constraints, False otherwise.

Schema (data type)

Type name: LengthBoundedDisjointPaths<G> where G: GraphSpec (default SimpleGraph)
Variants: graph topology (graph type parameter G)

Field Type Description
graph G The undirected graph G = (V, E)
source usize The source vertex s
sink usize The sink vertex t
num_paths_required usize J — minimum number of disjoint paths required
max_length usize K — maximum number of edges per path

Size fields (getter methods for overhead expressions):

  • num_vertices() -> usize (= |V|)
  • num_edges() -> usize (= |E|)
  • num_paths_required() -> usize (= J)
  • max_length() -> usize (= K)

Notes:

  • This is a satisfaction (decision) problem: Metric = bool, implementing SatisfactionProblem.
  • No weight type is needed.
  • Note: s and t are shared by all paths; the vertex-disjointness applies to internal vertices only.

Complexity

  • Decision complexity: NP-complete for all fixed K >= 5 (Itai, Perl, and Shiloach, 1982). Solvable in polynomial time for K <= 4.
  • Best known exact algorithm: For fixed K, brute force enumeration of all possible path combinations. For general K, this is equivalent to a constrained multi-commodity flow problem. Worst case exponential in |V|. For fixed J and K, the search space is polynomial O(n^{JK}).
  • Parameterized complexity: FPT when parameterized by J + K on certain graph classes. On general graphs, W[1]-hard parameterized by various combinations of parameters.
  • Complexity string (for general K >= 5): "2^(num_paths_required * num_vertices)" (brute force over J·|V| binary variables)
  • Special cases:
    • K <= 4: polynomial time
    • No length constraint (K = |V|): polynomial time by standard network flow (Menger's theorem)
    • Edge-disjoint version: NP-complete for K >= 5, polynomial for K <= 3, open for K = 4

declare_variants! guidance:

crate::declare_variants! {
    LengthBoundedDisjointPaths<SimpleGraph> => "2^(num_paths_required * num_vertices)",
}
  • References:
    • A. Itai, Y. Perl, Y. Shiloach (1982). "The complexity of finding maximum disjoint paths with length constraints." Networks, 12(3):277-286.

Extra Remark

Full book text:

INSTANCE: Graph G = (V,E), specified vertices s and t, positive integers J,K <= |V|.
QUESTION: Does G contain J or more mutually vertex-disjoint paths from s to t, none involving more than K edges?
Reference: [Itai, Perl, and Shiloach, 1977]. Transformation from 3SAT.
Comment: Remains NP-complete for all fixed K >= 5. Solvable in polynomial time for K <= 4. Problem where paths need only be edge-disjoint is NP-complete for all fixed K >= 5, polynomially solvable for K <= 3, and open for K = 4. The same results hold if G is a directed graph and the paths must be directed paths. The problem of finding the maximum number of disjoint paths from s to t, under no length constraint, is solvable in polynomial time by standard network flow techniques in both the vertex-disjoint and edge-disjoint cases.

How to solve

  • It can be solved by (existing) bruteforce. Enumerate all sets of J vertex-disjoint s-t paths of length <= K.
  • It can be solved by reducing to integer programming. Multi-commodity flow formulation with binary edge variables per path, flow conservation, vertex-disjointness, and path-length constraints.
  • Other: For K <= 4, polynomial-time algorithms exist. For unbounded K, standard maximum flow / Menger's theorem gives the answer in polynomial time.

Example Instance

Instance 1 (YES — disjoint paths exist):
Graph G with 8 vertices {0, 1, 2, 3, 4, 5, 6, 7} and 12 edges:

  • Edges: {0,1}, {0,2}, {0,3}, {1,4}, {2,5}, {3,6}, {4,7}, {5,7}, {6,7}, {1,5}, {2,6}, {3,4}
  • s = 0, t = 7, J = 3, K = 3

Three vertex-disjoint s-t paths of length <= 3:

  • P_1: 0 -> 1 -> 4 -> 7 (length 3)
  • P_2: 0 -> 2 -> 5 -> 7 (length 3)
  • P_3: 0 -> 3 -> 6 -> 7 (length 3)
  • All internal vertices {1,4}, {2,5}, {3,6} are pairwise disjoint
  • All paths have exactly 3 edges (<= K = 3)
  • Answer: YES

Instance 2 (YES — disjoint paths of different lengths):
Graph G with 7 vertices {0, 1, 2, 3, 4, 5, 6} and 8 edges:

  • Edges: {0,1}, {1,6}, {0,2}, {2,3}, {3,6}, {0,4}, {4,5}, {5,6}
  • s = 0, t = 6, J = 2, K = 3

Two vertex-disjoint s-t paths of length <= 3:

  • P_1: 0 → 1 → 6 (length 2)
  • P_2: 0 → 2 → 3 → 6 (length 3)
  • Internal vertex sets: {1}, {2,3} — pairwise disjoint ✓
  • P_1 has 2 edges (<= 3 ✓), P_2 has 3 edges (<= 3 ✓)
  • Answer: YES (paths have different lengths: 2 and 3)

Instance 3 (NO — not enough short disjoint paths):
Same graph as above but with J = 3, K = 2:

  • Any path of length 2 from 0 to 7 must go 0 -> v -> 7 where v is a common neighbor of 0 and 7.
  • Neighbors of 0: {1, 2, 3}. Neighbors of 7: {4, 5, 6}.
  • No vertex is a common neighbor of both 0 and 7, so no path of length 2 exists.
  • Answer: NO (cannot find even J = 1 path of length <= 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.modelA model problem to be implemented.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions