-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
FEASIBLE BASIS EXTENSION (P210) from Garey & Johnson, A6 MP4. A classical NP-complete problem arising in linear programming theory. The problem asks whether a linear system Ax = b, x >= 0 has a feasible basis containing a prescribed set of columns -- a fundamental question in simplex-method initialization and LP sensitivity analysis. Its NP-completeness (Murty 1972, via reduction from HAMILTONIAN CIRCUIT) shows that even basic structural questions about LP bases can be computationally hard.
Associated rules:
- R155: Hamiltonian Circuit -> Feasible Basis Extension (Murty 1972)
- [Rule] Feasible Basis Extension to ILP #784: Feasible Basis Extension -> ILP (Big-M linearization)
Definition
Name: FeasibleBasisExtension
Canonical name: Feasible Basis Extension; also: Basis Extension Problem
Reference: Garey & Johnson, Computers and Intractability, A6 MP4
Mathematical definition:
INSTANCE: An m x n integer matrix A, m < n, a column vector a-bar of length m, and a subset S of the columns of A with |S| < m.
QUESTION: Is there a feasible basis B for Ax-bar = a-bar, x-bar >= 0, i.e., a nonsingular m x m submatrix B of A such that B^{-1}a-bar >= 0, and such that B contains all the columns in S?
A "feasible basis" B is a set of m column indices such that the corresponding m x m submatrix A_B is nonsingular and the basic solution x_B = A_B^{-1} a-bar satisfies x_B >= 0 (with all non-basic variables set to zero). The extension requirement is that a prescribed subset S of columns must be included in B.
Variables
- Count: n - |S| binary variables (one per column of A not already in S), deciding which additional columns to include in the basis.
- Per-variable domain: binary {0, 1} -- whether column j (not in S) is selected for the basis.
- Meaning: The configuration selects m - |S| additional columns from A \ S to form a basis B = S union {selected columns}. The assignment is satisfying if (1) |B| = m, (2) A_B is nonsingular, and (3) A_B^{-1} a-bar >= 0.
Schema (data type)
Type name: FeasibleBasisExtension
Variants: none (integer matrix with no graph/weight parameterization)
| Field | Type | Description |
|---|---|---|
matrix |
Vec<Vec<i64>> |
The m x n integer matrix A (row-major) |
rhs |
Vec<i64> |
The column vector a-bar of length m |
required_columns |
Vec<usize> |
The subset S of column indices that must appear in the basis |
Notes:
- This is a satisfaction (decision) problem:
Metric = bool, implementingSatisfactionProblem. - Key getter methods:
num_rows()(= m),num_columns()(= n),num_required()(= |S|). - The matrix entries are integers (matching the GJ definition).
Complexity
- Decision complexity: NP-complete (Murty, 1972; transformation from HAMILTONIAN CIRCUIT).
- Best known exact algorithm: Brute-force enumeration of all C(n - |S|, m - |S|) subsets of columns to extend S, checking nonsingularity and nonnegativity of B^{-1}a-bar for each candidate basis. Time: O(C(n - |S|, m - |S|) * m^3) where m^3 is the cost of matrix inversion/solving. No sub-exponential algorithm is known.
- Complexity string for
declare_variants!:"2^num_columns * num_rows^3"(conservative upper bound; the binomial coefficient C(n-|S|, m-|S|) <= 2^n). - Special cases: When |S| = 0 (no required columns), the problem reduces to finding any feasible basis, which is equivalent to Phase I of the simplex method and can be solved in polynomial time. When |S| = m - 1, only one column needs to be chosen, and the problem is solvable in O(n * m^2) time.
- References:
- K.G. Murty (1972). "A fundamental problem in linear inequalities with applications to the travelling salesman problem." Mathematical Programming 2(3), pp. 296-308. The reduction from Hamiltonian Circuit is implicit in Murty's constructive approach; Garey & Johnson cite this as the NP-completeness source.
- R. Chandrasekaran, S.N. Kabadi, K.G. Murty (1982). "Some NP-complete problems in linear programming." Operations Research Letters 1(3), pp. 101-104. Explicitly establishes NP-completeness of several LP basis problems.
Specialization
- This is a special case of: Integer Linear Programming (the feasibility question can be encoded as an ILP).
- Known special cases: When |S| = 0, the problem is equivalent to LP Phase I (polynomial). When the matrix A has special structure (e.g., totally unimodular), the problem may be easier.
- Related problems: Linear Programming feasibility, Basis Enumeration.
Extra Remark
Full book text:
INSTANCE: An m x n integer matrix A, m < n, a column vector a-bar of length m, and a subset S of the columns of A with |S| < m.
QUESTION: Is there a feasible basis B for Ax-bar = a-bar, x-bar >= 0, i.e., a nonsingular m x m submatrix B of A such that B^{-1}a-bar >= 0, and such that B contains all the columns in S?
Reference: [Murty, 1972]. Transformation from HAMILTONIAN CIRCUIT.
How to solve
- It can be solved by (existing) bruteforce. Enumerate all C(n - |S|, m - |S|) ways to extend S to an m-column set B; for each, check that A_B is nonsingular and A_B^{-1} a-bar >= 0. Total time O(C(n,m) * m^3).
- It can be solved by reducing to integer programming. Encode column selection as binary variables, coefficient values via binary expansion, and link them with Big-M constraints. See companion issue: [Rule] Feasible Basis Extension to ILP #784.
- Other: (TBD)
Example Instance
Instance (satisfiable — trivial):
Consider the system Ax = a-bar, x >= 0 with m = 3 rows and n = 6 columns:
A = | 1 0 0 1 1 0 |
| 0 1 0 1 0 1 |
| 0 0 1 0 1 1 |
a-bar = (2, 3, 1)^T
Required columns: S = {0} (column 0 must be in the basis).
We need to find a 3 x 3 nonsingular submatrix B containing column 0 such that B^{-1} a-bar >= 0.
Analysis:
- Try B = {0, 1, 2}: A_B = I_3 (identity). B^{-1} a-bar = (2, 3, 1)^T >= 0. This is a feasible basis containing column 0.
- Answer: YES.
Instance (unsatisfiable — trivial):
A = | 1 1 1 |
| 2 2 3 |
m = 2, n = 3, a-bar = (1, 1)^T, S = {0, 1}.
Required columns S = {0, 1}, so B must be {0, 1} (since |B| = m = 2).
A_B = [[1, 1], [2, 2]], which is singular (columns are linearly dependent).
No feasible basis containing S exists.
Answer: NO.
Non-trivial instance (satisfiable):
A = | 1 0 1 2 -1 0 |
| 0 1 0 1 1 2 |
| 0 0 1 1 0 1 |
m = 3, n = 6, a-bar = (7, 5, 3)^T, S = {0, 1} (columns 0 and 1 must be in the basis).
Need to pick one more column from {2, 3, 4, 5} to form a 3-column basis B.
Exhaustive analysis of all 4 candidate extensions:
-
B = {0, 1, 2}:
A_B = [[1,0,1],[0,1,0],[0,0,1]]. det(A_B) = 1 (nonsingular).
Solve A_B x = (7,5,3)^T: row 3 gives x_2 = 3; row 2 gives x_1 = 5; row 1 gives x_0 = 7 - 3 = 4.
x_B = (4, 5, 3)^T >= 0. Feasible basis. ✅ -
B = {0, 1, 3}:
A_B = [[1,0,2],[0,1,1],[0,0,1]]. det(A_B) = 1 (nonsingular).
Solve A_B x = (7,5,3)^T: row 3 gives x_3 = 3; row 2 gives x_1 = 5 - 3 = 2; row 1 gives x_0 = 7 - 6 = 1.
x_B = (1, 2, 3)^T >= 0. Feasible basis. ✅ -
B = {0, 1, 4}:
A_B = [[1,0,-1],[0,1,1],[0,0,0]]. det(A_B) = 0 (singular). Not a valid basis. ❌ -
B = {0, 1, 5}:
A_B = [[1,0,0],[0,1,2],[0,0,1]]. det(A_B) = 1 (nonsingular).
Solve A_B x = (7,5,3)^T: row 3 gives x_5 = 3; row 2 gives x_1 = 5 - 6 = -1.
x_B = (7, -1, 3)^T. x_1 < 0. Not feasible (nonnegativity violated). ❌
Summary: 2 feasible bases ({0,1,2} and {0,1,3}), 1 singular, 1 infeasible. Answer: YES.
The two feasible bases yield different basic solutions — (4,5,3) vs (1,2,3) — confirming the instance is non-trivial and exercises both the nonsingularity and nonnegativity checks.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status