Motivation
FEEDBACK ARC SET from Garey & Johnson, A1.1 GT8. A classical NP-complete problem (Karp, 1972) that asks for the minimum number of arcs to remove from a directed graph to make it acyclic. It appears in ranking aggregation, sports tournament scheduling, deadlock avoidance, and causal inference. The problem is the "arc" analogue of the Feedback Vertex Set problem; unlike undirected feedback arc set (which is trivially solvable since every cycle must have an edge and spanning trees are cycle-free), the directed version is NP-complete.
Definition
Name: MinimumFeedbackArcSet
Canonical name: Directed Feedback Arc Set (DFAS); also: Minimum Feedback Arc Set, Minimum Acyclic Subgraph (complement formulation)
Reference: Garey & Johnson, Computers and Intractability, A1.1 GT8
Mathematical definition:
INSTANCE: Directed graph G = (V,A), positive integer K ≤ |A|.
QUESTION: Is there a subset A' ⊆ A with |A'| ≤ K such that A' contains at least one arc from every directed cycle in G?
The optimization version (which is the natural Rust model) asks: find the minimum-size subset A' ⊆ A such that G − A' is a directed acyclic graph (equivalently, find the maximum acyclic subgraph).
Variables
- Count: m = |A| binary variables (one per arc)
- Per-variable domain: binary {0, 1} — whether arc a ∈ A is included in the feedback arc set A'
- Meaning: variable x_a = 1 if arc a is selected into the FAS. The configuration (x_0, ..., x_{m-1}) encodes a candidate subset A' ⊆ A. The assignment is valid (a valid FAS) if for every directed cycle C in G, at least one arc of C has x_a = 1.
Schema (data type)
Type name: MinimumFeedbackArcSet
Variants: graph topology (directed graph type parameter)
| Field |
Type |
Description |
graph |
DirectedGraph |
The directed graph G = (V, A) on which a feedback arc set is sought |
Notes:
- This is an optimization (minimization) problem:
Metric = SolutionSize<i32>, implementing OptimizationProblem.
- The objective is to minimize |A'|, the number of selected arcs.
- Variables are indexed over arcs (edges), not vertices — the configuration space has dimension m = |A|.
- Key getter methods needed:
num_vertices() (= |V|), num_edges() (= |A|). Note: although the problem literature uses "arcs" for directed edges, the getter is named num_edges() for consistency with the existing codebase convention (e.g., SimpleGraph::num_edges()).
- The complement formulation (maximum acyclic subgraph) keeps m − |A'| arcs and is equivalent.
- Prerequisite: The codebase does not currently have a
DirectedGraph type. A separate issue and PR must be filed and merged to add a directed graph topology type to src/models/graph/ before this model can be implemented. The current graph types (SimpleGraph, PlanarGraph, BipartiteGraph, UnitDiskGraph, KingsSubgraph, TriangularSubgraph) are all undirected.
Complexity
- Decision complexity: NP-complete (Karp, 1972; transformation from VERTEX COVER per Garey & Johnson's presentation).
- Best known exact algorithm: O*(2^n) time via dynamic programming over subsets of vertices (Held-Karp style DP over vertex orderings; see Fomin & Kratsch, Exact Exponential Algorithms, Springer, 2010). This is the best known worst-case bound for the general directed FAS problem; improving this to sub-2^n is an explicit open problem. This is the bound to use in
declare_variants!.
- Alternative exact approach: O*(2^m) brute force over arc subsets, where m = |A| (enumerate all 2^m subsets A' ⊆ A and check acyclicity). Practical exact methods use branch-and-bound with ILP or cycle enumeration (Baharev, Schichl, Neumaier, Achterberg, 2021).
- Polynomial-time solvable cases: Planar digraphs (Lucchesi & Younger, 1978; via the Lucchesi-Younger theorem relating minimum FAS to maximum cycle packing). Also solvable for DAGs (trivially: empty FAS).
- FPT (parameterized by k): Fixed-parameter tractable: O(4^k · k! · n^{O(1)}) algorithm. Note: FAS is FPT via a standard reduction to Directed Feedback Vertex Set (DFVS); the FPT algorithm is originally for DFVS by Chen, Liu, Lu, O'Sullivan, and Razgon (2008), and the FAS result follows because any FAS instance on G can be transformed to a DFVS instance on the line digraph of G with the same parameter. Whether FAS has a polynomial kernel remains open.
- References:
- R.M. Karp (1972). "Reducibility Among Combinatorial Problems." Complexity of Computer Computations, pp. 85–103. Plenum Press. Original NP-completeness proof.
- F.V. Fomin and D. Kratsch (2010). Exact Exponential Algorithms. Springer. Texts in Theoretical Computer Science. Reference for O*(2^n) DP approach to feedback arc set problems.
- C.L. Lucchesi and D.H. Younger (1978). "A minimax theorem for directed graphs." Journal of the London Mathematical Society, 17(3):369–374. Polynomial time for planar digraphs.
- J. Chen, Y. Liu, S. Lu, B. O'Sullivan, I. Razgon (2008). "A Fixed-Parameter Algorithm for the Directed Feedback Vertex Set Problem." Journal of the ACM, 55(5), Article 21. FPT result for DFVS; applicable to FAS via reduction to DFVS on the line digraph.
- A. Baharev, H. Schichl, A. Neumaier, T. Achterberg (2021). "An Exact Method for the Minimum Feedback Arc Set Problem." ACM Journal of Experimental Algorithmics, 26, Article 1.4. Practical exact solver.
Specialization
- This is a special case of: (none — FAS is a fundamental problem)
- Known special cases: FAS on tournament graphs (every pair of vertices has exactly one arc; solvable in O*(1.6181^n) and has a 3-approximation), FAS on planar digraphs (polynomial time)
- Restriction: The undirected analogue (minimum feedback edge set in an undirected graph) is trivially polynomial — it equals m − (n − c) where c is the number of connected components (i.e., the number of non-tree edges in a spanning forest). The directed version is fundamentally harder due to directed cycle structure.
Extra Remark
Full book text:
INSTANCE: Directed graph G = (V,A), positive integer K ≤ |A|.
QUESTION: Is there a subset A' ⊆ A with |A'| ≤ K such that A' contains at least one arc from every directed cycle in G?
Reference: [Karp, 1972]. Transformation from VERTEX COVER.
Comment: Remains NP-complete for digraphs in which no vertex has total indegree and out-degree more than 3, and for edge digraphs [Gavril, 1977a]. Solvable in polynomial time for planar digraphs [Luchesi, 1976]. The corresponding problem for undirected graphs is trivially solvable in polynomial time.
How to solve
Example Instance
Directed graph G with 6 vertices {0, 1, 2, 3, 4, 5} and 9 arcs:
- Arc list (indexed 0–8):
- a₀: (0→1), a₁: (1→2), a₂: (2→0) — forms directed cycle C₁: 0→1→2→0
- a₃: (1→3), a₄: (3→4), a₅: (4→1) — forms directed cycle C₂: 1→3→4→1
- a₆: (2→5), a₇: (5→3), a₈: (3→0)
All simple directed cycles:
- C₁: 0 → 1 → 2 → 0 (arcs a₀, a₁, a₂)
- C₂: 1 → 3 → 4 → 1 (arcs a₃, a₄, a₅)
- C₃: 0 → 1 → 3 → 0 (arcs a₀, a₃, a₈)
- C₄: 2 → 5 → 3 → 0 → 1 → 2 (arcs a₆, a₇, a₈, a₀, a₁)
Budget: K = 2
Minimum FAS analysis:
- Can we break all cycles with 2 arcs?
- Select A' = {a₂, a₅} = {(2→0), (4→1)}:
- C₁ (a₀, a₁, a₂): a₂ ∈ A' ✓
- C₂ (a₃, a₄, a₅): a₅ ∈ A' ✓
- C₃ (a₀, a₃, a₈): neither a₂ nor a₅ appears. NOT broken ✗
- Select A' = {a₀, a₄} = {(0→1), (3→4)}:
- C₁ (a₀, a₁, a₂): a₀ ∈ A' ✓
- C₂ (a₃, a₄, a₅): a₄ ∈ A' ✓
- C₃ (a₀, a₃, a₈): a₀ ∈ A' ✓
- C₄ (a₆, a₇, a₈, a₀, a₁): a₀ ∈ A' ✓
- All cycles broken! ✓
- Minimum FAS = {a₀, a₄} = {(0→1), (3→4)}, size = 2.
Verification:
After removing arcs (0→1) and (3→4), remaining arcs: (1→2), (2→0), (1→3), (4→1), (2→5), (5→3), (3→0). Check for directed cycles among remaining arcs by tracing from every vertex with outgoing arcs:
- From vertex 1: outgoing arcs = (1→2), (1→3).
- 1→2→0 (vertex 0 has no outgoing arcs, sink) → dead end. ✓
- 1→2→5→3→0 (sink) → dead end. ✓
- 1→3→0 (sink) → dead end. ✓
- No cycle through vertex 1. ✓
- From vertex 2: outgoing arcs = (2→0), (2→5).
- 2→0 (sink) → dead end. ✓
- 2→5→3→0 (sink) → dead end. ✓
- No cycle through vertex 2. ✓
- From vertex 3: outgoing arcs = (3→0).
- 3→0 (sink) → dead end. ✓
- No cycle through vertex 3. ✓
- From vertex 4: outgoing arcs = (4→1).
- 4→1→2→0 (sink) → dead end. ✓
- 4→1→2→5→3→0 (sink) → dead end. ✓
- 4→1→3→0 (sink) → dead end. ✓
- No cycle through vertex 4. ✓
- From vertex 5: outgoing arcs = (5→3).
- 5→3→0 (sink) → dead end. ✓
- No cycle through vertex 5. ✓
- From vertex 0: no outgoing arcs (a₀ removed). Vertex 0 is a sink. ✓
- No directed cycle exists in the residual graph — this is a DAG. ✓
Budget: K = 2 → answer is YES (FAS of size ≤ 2 exists). For K = 1 → answer is NO (each of C₁, C₂, C₃ shares only arc a₀ between C₁ and C₃; removing a₀ still leaves C₂ intact).
Motivation
FEEDBACK ARC SET from Garey & Johnson, A1.1 GT8. A classical NP-complete problem (Karp, 1972) that asks for the minimum number of arcs to remove from a directed graph to make it acyclic. It appears in ranking aggregation, sports tournament scheduling, deadlock avoidance, and causal inference. The problem is the "arc" analogue of the Feedback Vertex Set problem; unlike undirected feedback arc set (which is trivially solvable since every cycle must have an edge and spanning trees are cycle-free), the directed version is NP-complete.
Definition
Name:
MinimumFeedbackArcSetCanonical name: Directed Feedback Arc Set (DFAS); also: Minimum Feedback Arc Set, Minimum Acyclic Subgraph (complement formulation)
Reference: Garey & Johnson, Computers and Intractability, A1.1 GT8
Mathematical definition:
INSTANCE: Directed graph G = (V,A), positive integer K ≤ |A|.
QUESTION: Is there a subset A' ⊆ A with |A'| ≤ K such that A' contains at least one arc from every directed cycle in G?
The optimization version (which is the natural Rust model) asks: find the minimum-size subset A' ⊆ A such that G − A' is a directed acyclic graph (equivalently, find the maximum acyclic subgraph).
Variables
Schema (data type)
Type name:
MinimumFeedbackArcSetVariants: graph topology (directed graph type parameter)
graphDirectedGraphNotes:
Metric = SolutionSize<i32>, implementingOptimizationProblem.num_vertices()(= |V|),num_edges()(= |A|). Note: although the problem literature uses "arcs" for directed edges, the getter is namednum_edges()for consistency with the existing codebase convention (e.g.,SimpleGraph::num_edges()).DirectedGraphtype. A separate issue and PR must be filed and merged to add a directed graph topology type tosrc/models/graph/before this model can be implemented. The current graph types (SimpleGraph,PlanarGraph,BipartiteGraph,UnitDiskGraph,KingsSubgraph,TriangularSubgraph) are all undirected.Complexity
declare_variants!.Specialization
Extra Remark
Full book text:
INSTANCE: Directed graph G = (V,A), positive integer K ≤ |A|.
QUESTION: Is there a subset A' ⊆ A with |A'| ≤ K such that A' contains at least one arc from every directed cycle in G?
Reference: [Karp, 1972]. Transformation from VERTEX COVER.
Comment: Remains NP-complete for digraphs in which no vertex has total indegree and out-degree more than 3, and for edge digraphs [Gavril, 1977a]. Solvable in polynomial time for planar digraphs [Luchesi, 1976]. The corresponding problem for undirected graphs is trivially solvable in polynomial time.
How to solve
Example Instance
Directed graph G with 6 vertices {0, 1, 2, 3, 4, 5} and 9 arcs:
All simple directed cycles:
Budget: K = 2
Minimum FAS analysis:
Verification:
After removing arcs (0→1) and (3→4), remaining arcs: (1→2), (2→0), (1→3), (4→1), (2→5), (5→3), (3→0). Check for directed cycles among remaining arcs by tracing from every vertex with outgoing arcs:
Budget: K = 2 → answer is YES (FAS of size ≤ 2 exists). For K = 1 → answer is NO (each of C₁, C₂, C₃ shares only arc a₀ between C₁ and C₃; removing a₀ still leaves C₂ intact).