TExcelTAD
Home › Linear Programming & Duality for Algorithms › Polytopes, Vertices and Basic Feasible Solutions

Polytopes, Vertices and Basic Feasible Solutions

The optimum of an LP sits at a corner of the feasible region. For combinatorial problems this is the central fact: if every corner of the region is an integer point, the LP solves the integer problem for free. This lesson makes "corner" precise in three equivalent ways (geometric, algebraic and in terms of tight constraints), proves the equivalence, and uses it to enumerate the corners of two small matching polytopes, one with only integral corners and one without. The continuous treatment, with the same fundamental theorem, is in The Geometry of Linear Programs.

Polyhedra and polytopes

A polyhedron is a set P={x∈Rn:Ax≤b}P = \{ x \in \mathbb{R}^n : Ax \le b \}, an intersection of finitely many half-spaces. A bounded polyhedron is a polytope; by the Minkowski-Weyl theorem a polytope is also the convex hull of finitely many points, so the two descriptions (by inequalities, by corner points) describe the same objects. For a point x∈Px \in P, call constraint ii tight if aiTx=bia_i^T x = b_i.

Three ways to say that x∈Px \in P is a corner:

  • Vertex: there is a vector cc such that xx is the unique maximizer of cTzc^T z over PP.
  • Extreme point: xx is not the midpoint of two other points of PP; that is, x=12(y+z)x = \frac{1}{2}(y + z) with y,z∈Py, z \in P forces y=z=xy = z = x.
  • Basic feasible solution: among the constraints tight at xx, there are nn whose normal vectors aia_i are linearly independent.

Theorem. For a point of a polyhedron, the three notions coincide.

The lab shows the first definition at work on the "fractional corners" polygon. Turn the objective direction θ\theta: for almost every direction one vertex is the unique maximizer, and the optimum jumps from vertex to vertex as θ\theta passes the normal of an edge. At exactly those directions the whole edge is optimal (the lab reports a tie), but even then the optimal set contains vertices.

00224466881010maximise 0.77x + 0.64ysubject tox + y ≤ 4.5−x + 2y ≤ 32x − y ≤ 6.5x ≥ 0, y ≥ 0LP optimum (a vertex)best integer pointlevel line c · v = z*

In equational form {x:Ax=b, x≥0}\{ x : Ax = b,\ x \ge 0 \} with AA of full row rank mm, the third notion has a concrete algebraic version. A basis is a set BB of mm column indices whose columns ABA_B are linearly independent. Setting the other n−mn - m variables to zero and solving ABxB=bA_B x_B = b gives the basic solution of BB; it is a basic feasible solution (BFS) if also xB≥0x_B \ge 0.

Proof that extreme points and basic feasible solutions coincide (equational form)

Let xx be feasible and let S={j:xj>0}S = \{ j : x_j > 0 \} be its support. Claim: xx is an extreme point if and only if the columns ASA_S are linearly independent (and then SS can be extended to a basis, so xx is a BFS).

If the columns are dependent, pick d≠0d \ne 0 with Ad=0A d = 0 and dj=0d_j = 0 for j∉Sj \notin S. For small ε>0\varepsilon > 0 both x+εdx + \varepsilon d and x−εdx - \varepsilon d satisfy A(⋅)=bA(\cdot) = b and stay non-negative (the entries of xx on SS are strictly positive). So xx is the midpoint of two distinct feasible points: not extreme.

If the columns are independent, suppose x=12(y+z)x = \frac{1}{2}(y + z) with y,zy, z feasible. For j∉Sj \notin S, 0=xj=12(yj+zj)0 = x_j = \frac{1}{2}(y_j + z_j) with yj,zj≥0y_j, z_j \ge 0 forces yj=zj=0y_j = z_j = 0. So AS(yS−xS)=Ay−Ax=0A_S (y_S - x_S) = A y - A x = 0, and independence gives y=xy = x; likewise z=xz = x. So xx is extreme.

For vertices: if xx is the unique maximizer of cTzc^T z, it cannot be a midpoint of two other points of PP (one of them would score at least as much). Conversely, for a BFS with basis BB, the objective c=−1Nc = -\mathbf{1}_{N} (minus one on the non-basic variables, zero elsewhere) is maximized exactly at points with xN=0x_N = 0, and ABxB=bA_B x_B = b has only one solution.

Fundamental theorem of linear programming. If an LP in equational form is feasible and bounded, it has an optimal solution that is a BFS. (Sketch: start from any optimal point; while its support columns are dependent, move along the direction dd of the proof, which does not change the objective, as the LP is bounded and x±εdx \pm \varepsilon d are both feasible, until some variable hits zero; the support shrinks each time.) Since there are at most (nm)\binom{n}{m} bases, an LP can be solved by enumerating them, which is finite but exponential.

Enumerating bases

The workshop LP in equational form has five variables (xx, yy and three slacks) and three rows, so there are (53)=10\binom{5}{3} = 10 candidate bases. The program solves each 3×33 \times 3 system in exact arithmetic and sorts the outcomes into singular, infeasible and feasible.

python · try it yourself
from fractions import Fraction as F
from itertools import combinations

def solve(M, rhs):
    """Gauss-Jordan elimination over the rationals; None if M is singular."""
    n = len(M)
    T = [[F(v) for v in row] + [F(r)] for row, r in zip(M, rhs)]
    for col in range(n):
        piv = next((r for r in range(col, n) if T[r][col] != 0), None)
        if piv is None:
            return None
        T[col], T[piv] = T[piv], T[col]
        for r in range(n):
            if r != col and T[r][col] != 0:
                f = T[r][col] / T[col][col]
                T[r] = [a - f * b for a, b in zip(T[r], T[col])]
    return [T[i][n] / T[i][i] for i in range(n)]

names = ["x", "y", "s1", "s2", "s3"]
A = [[2, 1, 1, 0, 0], [1, 3, 0, 1, 0], [1, 0, 0, 0, 1]]
b = [10, 15, 4]
for B in combinations(range(5), 3):
    xB = solve([[A[i][j] for j in B] for i in range(3)], b)
    label = "{" + ",".join(names[j] for j in B) + "}"
    if xB is None:
        print(f"{label:12} singular")
        continue
    full = [F(0)] * 5
    for j, v in zip(B, xB):
        full[j] = v
    status = "BFS" if min(xB) >= 0 else "infeasible"
    print(f"{label:12} {status:10} (x, y) = ({full[0]}, {full[1]})")
{x,y,s1}     infeasible (x, y) = (4, 11/3)
{x,y,s2}     BFS        (x, y) = (4, 2)
{x,y,s3}     BFS        (x, y) = (3, 4)
{x,s1,s2}    BFS        (x, y) = (4, 0)
{x,s1,s3}    infeasible (x, y) = (15, 0)
{x,s2,s3}    infeasible (x, y) = (5, 0)
{y,s1,s2}    singular
{y,s1,s3}    BFS        (x, y) = (0, 5)
{y,s2,s3}    infeasible (x, y) = (0, 10)
{s1,s2,s3}   BFS        (x, y) = (0, 0)

Five bases are feasible and they give the five corners of the workshop polygon. Four bases give points that violate a sign constraint (intersections of constraint lines outside the polygon), and one basis is singular. Each corner here comes from exactly one basis; at a degenerate vertex, where more than nn constraints are tight, several bases describe the same point, which is what makes the simplex method stall (Degeneracy, Cycling and Bland's Rule).

Corners of matching polytopes

The fractional matching polytope of a graph is {x∈RE:∑e∋vxe≤1 for every vertex v, x≥0}\{ x \in \mathbb{R}^E : \sum_{e \ni v} x_e \le 1 \text{ for every vertex } v,\ x \ge 0 \}. Its integer points are exactly the matchings. Are its vertices integer points? The program finds all vertices directly from the third definition: choose ∣E∣|E| constraints, solve them as equations, and keep the solutions that satisfy all constraints.

python · try it yourself
from fractions import Fraction as F
from itertools import combinations

def solve(M, rhs):
    n = len(M)
    T = [[F(v) for v in row] + [F(r)] for row, r in zip(M, rhs)]
    for col in range(n):
        piv = next((r for r in range(col, n) if T[r][col] != 0), None)
        if piv is None:
            return None
        T[col], T[piv] = T[piv], T[col]
        for r in range(n):
            if r != col and T[r][col] != 0:
                f = T[r][col] / T[col][col]
                T[r] = [a - f * b for a, b in zip(T[r], T[col])]
    return [T[i][n] / T[i][i] for i in range(n)]

def matching_vertices(nv, edges):
    m = len(edges)
    rows = [([1 if v in e else 0 for e in edges], 1) for v in range(nv)]        # degree <= 1
    rows += [([-1 if k == j else 0 for k in range(m)], 0) for j in range(m)]     # -x_e <= 0
    found = set()
    for S in combinations(rows, m):
        x = solve([r for r, _ in S], [r for _, r in S])
        if x is not None and all(sum(a * xi for a, xi in zip(r, x)) <= rhs for r, rhs in rows):
            found.add(tuple(x))
    return sorted(found)

for name, nv, edges in [("4-cycle (bipartite)", 4, [(0, 1), (1, 2), (2, 3), (3, 0)]),
                        ("triangle (odd cycle)", 3, [(0, 1), (1, 2), (0, 2)])]:
    verts = matching_vertices(nv, edges)
    frac = [v for v in verts if any(c.denominator != 1 for c in v)]
    print(f"{name}: {len(verts)} vertices, fractional ones: {[tuple(str(c) for c in v) for v in frac]}")
4-cycle (bipartite): 7 vertices, fractional ones: []
triangle (odd cycle): 5 vertices, fractional ones: [('1/2', '1/2', '1/2')]

The 4-cycle's polytope has 7 vertices: the empty matching, four single edges and two perfect matchings, all integral. The triangle's has 5: the empty matching, three single edges and the extra vertex (12,12,12)(\frac{1}{2}, \frac{1}{2}, \frac{1}{2}), with value 32\frac{3}{2}, larger than any matching (one edge). This is the whole story of bipartite matching in miniature: for bipartite graphs the incidence matrix is totally unimodular and every vertex is integral (Totally Unimodular Matrices); odd cycles create half-integral vertices, which Edmonds (1965) removed by adding the odd-set constraints ∑e⊆Sxe≤∣S∣−12\sum_{e \subseteq S} x_e \le \frac{\lvert S \rvert - 1}{2} for odd SS.

How many vertices can there be?

A polytope in Rn\mathbb{R}^n with mm facets has at most (mn)\binom{m}{n} vertices, and McMullen's upper bound theorem (1970) gives the exact maximum, which for fixed nn is of order m⌊n/2⌋m^{\lfloor n/2 \rfloor}. The cube [0,1]n[0, 1]^n already shows the exponential behaviour: 2n2n constraints, 2n2^n vertices. Any algorithm that looks at all vertices is exponential, which is why the simplex method only walks along a path of improving vertices, the subject of the next lesson.

python · try it yourself
from math import comb

print(" n  constraints  cube vertices  bound C(2n, n)")
for n in [2, 4, 8, 16, 32]:
    print(f"{n:2}  {2 * n:11}  {2 ** n:13}  {comb(2 * n, n):14}")
 n  constraints  cube vertices  bound C(2n, n)
 2            4              4               6
 4            8             16              70
 8           16            256           12870
16           32          65536       601080390
32           64     4294967296  1832624140942590534

Test yourself

In equational form with mm rows and nn variables, how many variables can be non-zero at a basic feasible solution?

  1. Exactly n−mn - m
  2. At most mm
  3. At least mm
  4. Exactly nn

Why is a feasible point whose support columns are linearly dependent not a vertex?

  1. It violates a constraint
  2. Moving by ±εd\pm \varepsilon d for a dependence dd on the support keeps feasibility, so the point is a midpoint of two feasible points
  3. Its objective value is zero
  4. It has too many tight constraints

Which vertex appears in the fractional matching polytope of a triangle but not of a 4-cycle?

  1. The all-zero vector
  2. A half-integral point with xe=12x_e = \frac{1}{2} on every edge of the odd cycle
  3. A point with one coordinate equal to 2
  4. None, both are integral