Skip to content

[Rule] MinimumFeedbackVertexSet to ILP #141

@fliingelephant

Description

@fliingelephant

Source: MinimumFeedbackVertexSet (#140)
Target: ILP
Motivation: Enables exact solving of directed FVS via ILP solvers. The topological-ordering formulation is compact (2n variables, m constraints).
Reference:

Reduction Algorithm

Notation:

  • Source: MinimumFeedbackVertexSet instance with directed graph G = (V, A), n = |V|, m = |A|, weights w_i
  • Target: ILP instance with 2n variables and m constraints

Key idea: A directed graph is a DAG if and only if it admits a topological ordering. Encode this with integer ordering variables and linear constraints.

Variable mapping:

Variable Count Domain Meaning
$x_i$ n {0, 1} vertex i is removed
$o_i$ n {0, ..., n−1} topological order of vertex i

Constraint transformation:

For each arc $(u \to v) \in A$: if both endpoints are kept, the ordering must be consistent:

$$o_v - o_u \geq 1 - n \cdot (x_u + x_v)$$

  • When $x_u = x_v = 0$ (both kept): $o_v \geq o_u + 1$ (enforces strict topological order)
  • When either is removed: $o_v - o_u \geq 1 - n$ (always satisfied since $0 \leq o_i \leq n-1$)

Objective: minimize $\sum_i w_i \cdot x_i$

Correctness:

  • ($\Rightarrow$) If G[V\S] is a DAG, it has a topological ordering. Set $o_i$ to the topological position. All arc constraints satisfied.
  • ($\Leftarrow$) If the ILP is feasible with all arcs between kept vertices satisfying $o_v > o_u$, no directed cycle can exist (a cycle $v_1 \to v_2 \to \cdots \to v_k \to v_1$ would require $o_{v_1} < o_{v_2} < \cdots < o_{v_k} < o_{v_1}$, a contradiction).

Size Overhead

Target metric (code name) Polynomial (using symbols above)
num_vars $2n$
num_constraints $m$

Validation Method

  • Cross-check with brute-force solver on small instances (n ≤ 10)
  • Verify on known special cases: directed cycle $C_n$ has FVS = 1, complete directed graph (both arcs per pair) has FVS = n − 1
  • Compare against example instance: FVS = 3

Example

Source: Cycle of triangles (n = 9, m = 15) from #140

Vertices: {0, 1, 2, 3, 4, 5, 6, 7, 8}
Arcs: {0→1, 1→2, 2→0, 3→4, 4→5, 5→3, 6→7, 7→8, 8→6,
       1→3, 4→6, 7→0, 2→5, 5→8, 8→2}
Unit weights: w_i = 1 for all i

Target ILP:

Variables: 9 binary x_i, 9 integer o_i ∈ {0,...,8}  (18 total)
Constraints: 15 (one per arc)
Objective: minimize Σ x_i

Solution: x = (1, 0, 0, 1, 0, 0, 0, 0, 1) → S = {0, 3, 8}, objective = 3.

Topological ordering of remaining DAG on {1, 2, 4, 5, 6, 7}:

o_1 = 0, o_4 = 1, o_2 = 2, o_6 = 3, o_5 = 4, o_7 = 5

Verification of arc constraints (remaining arcs only):

1→2: o_2 − o_1 = 2 ≥ 1  ✓
4→5: o_5 − o_4 = 3 ≥ 1  ✓
6→7: o_7 − o_6 = 2 ≥ 1  ✓
4→6: o_6 − o_4 = 2 ≥ 1  ✓
2→5: o_5 − o_2 = 2 ≥ 1  ✓

All 10 removed-endpoint arc constraints: relaxed to $o_v − o_u \geq 1 − 9$ (trivially satisfied) ✓

Overhead: n = 9, m = 15 → num_vars = 18, num_constraints = 15.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.ruleA new reduction rule to be added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions