The Linear Programming (LP) method approaches optimization problems where both the objective function and all constraints are linear functions of the decision variables.
LP seeks to maximize or minimize a linear objective function subject to linear inequality constraints, equality constraints, and variable bounds—guaranteeing that any local optimum is also a global optimum due to the convexity of the feasible region.
Fundamental Components of a Linear Program:
The 3-Step Formulation Process Consider a standard linear program solved via the Linprog interface:
- Decision Variables: Define the vector of unknown variables \mathbf{x} = [x_1, x_2]^T to be optimized.
- Objective Function Vector: Specify the objective coefficient vector :math:\mathbf{f}, defining the linear cost or performance surface to minimize:
- Constraints & Bounding Domains: Formulate inequality systems \mathbf{A}\mathbf{x} \le \mathbf{b}, equality restrictions \mathbf{A}_{eq}\mathbf{x} = \mathbf{b}_{eq}, and lower/upper variable bounds :math:\mathbf{Lb} \le \mathbf{x} \le \mathbf{Ub}.
## Constraint Types in Linprog
The Linprog solver handles three levels of constraint complexity depending on problem parameters: - Inequality Constraints (\mathbf{A}\mathbf{x} \le \mathbf{b}): Defines the primary polyhedral boundary of the feasible region. - Equality Constraints (\mathbf{A}_{eq}\mathbf{x} = \mathbf{b}_{eq}): Restricts the feasible solution domain to a lower-dimensional affine subspace or hyperplane within the polyhedron. - Variable Bounds (\mathbf{Lb} \le \mathbf{x} \le \mathbf{Ub}): Sets direct lower and upper box constraints on individual decision variables, improving solver efficiency.
Comparison: Linprog Formulation Levels Feature | Basic Inequality LP | LP with Equality Constraints | Fully Bounded LP Objective | \min \mathbf{f}^T \mathbf{x} | \min \mathbf{f}^T \mathbf{x} | \min \mathbf{f}^T \mathbf{x} Inequalities | \mathbf{A}\mathbf{x} \le \mathbf{b} | \mathbf{A}\mathbf{x} \le \mathbf{b} | \mathbf{A}\mathbf{x} \le \mathbf{b} Equalities | None | \mathbf{A}_{eq}\mathbf{x} = \mathbf{b}_{eq} | \mathbf{A}_{eq}\mathbf{x} = \mathbf{b}_{eq} Variable Bounds | Implicit / Unbounded | Implicit / Unbounded | Explicit (:math:\mathbf{Lb}, \mathbf{Ub})
Example 1: Standard Linear Program with Inequality Constraints
Minimizing a linear objective function subject to a system of linear inequalities defining a 2D polyhedral feasible region:
Example 1C#
Optimal solution found 0.6667 1.3333
Example 2: Linear Program with Inequality and Equality Constraints
Incorporating linear equality constraints \mathbf{A}_{eq}\mathbf{x} = \mathbf{b}_{eq} to restrict the search space along a hyper-plane intersecting the feasible region:
Example 2C#
Optimal solution found 0 2
Example 3: Fully Constrained Linear Program with Variable Bounds
Enforcing explicit lower (\mathbf{Lb}) and upper (\mathbf{Ub}) limits on each decision variable alongside inequality and equality systems:
Example 3C#
Optimal solution found 0.1875 1.2500