Mixed Integer Linear Programming


Lecture 21

October 23, 2023

  Activating project at `~/Teaching/BEE4750/fall2023/slides`

Review and Questions

Linear Programming

  • Assumptions of:
    • certainty
    • divisibility
    • linearity
  • Solutions must be at intersections of constraints.
  • Shadow prices: value of relaxing constraints.
  • Saw examples from power systems and air quality

Questions

Poll Everywhere QR Code

Text: VSRIKRISH to 22333

URL: https://pollev.com/vsrikrish

See Results

Mixed Integer Linear Programming

Problems with Discrete Decisions

Economic dispatch: Assumed we had a fleet of online generators.

What if we had to decide if generators should be on/off to avoid causing additional expense from minimum power/ramping constraints?

Problems with Discrete Decisions

These types of decisions are common for infrastructure operations or investment problems.

Fixed Costs

A key consideration when deciding whether to operate something are fixed costs.

  • Fixed costs: Labor, etc, required to operate or produce regardless of quantity.
  • Variable costs: Costs of inputs (energy, additional labor, materials) required to operate or produce per unit of time/quantity.

Fixed Costs Cause Discontinuities

A discontinuous cost function is one way to violate the principles of linear programming!

Operational Status As Decision Variables

The potential decision to not operate means that we need to introduce new indicator variables, which flag on/off status:

\[ \mathbb{I}_g = \begin{cases} 0 & \text{off} \\ 1 & \text{on} \end{cases} \]

When we include variables which are binary or, more generally, integer, we now have a mixed-integer linear program.

Discrete Decision Variables Violate Divisibility

x = 2:0.1:10.75
f1(x) = 4.5 .* x
f2(x) = -x .+ 16
f3(x) = -1.5 .* x .+ 12
f4(x) = 0.5 .* x

p = plot(x, max.(f3(x), f4(x)), fillrange=min.(f1(x), f2(x)), color=:lightblue, grid=true, legend=false, xlabel=L"x", ylabel=L"y", xlims=(0, 12), framestyle=:origin, ylims=(0, 15), minorticks=2, guidefontsize=16, tickfontsize=14)
plot!(-2:0.1:20, f1.(-2:0.1:20), color=:green, linewidth=3)
plot!(-2:0.1:20, f2.(-2:0.1:20), color=:red, linewidth=3)
plot!(-2:0.1:20, f3.(-2:0.1:20), color=:brown, linewidth=3)
plot!(-2:0.1:20, f4.(-2:0.1:20), color=:purple, linewidth=3)
plot!(gridlinewidth=1, gridalpha=0.75)
plot!(xticks=round(Int,xlims(p)[1]):round(Int,xlims(p)[2]), yticks=round(Int,ylims(p)[1]):round(Int,ylims(p)[2]))
plot!(size=(600, 500))

Recall that for LPs, solutions must occur at corners of the feasible polyhedra.

Discrete Decision Variables Violate Divisibility

x = 2:0.1:10.75
f1(x) = 4.5 .* x
f2(x) = -x .+ 16
f3(x) = -1.5 .* x .+ 12
f4(x) = 0.5 .* x

p = plot(x, max.(f3(x), f4(x)), fillrange=min.(f1(x), f2(x)), color=:lightblue, grid=true, legend=false, xlabel=L"x", ylabel=L"y", xlims=(0, 12), framestyle=:origin, ylims=(0, 15), minorticks=2, guidefontsize=16, tickfontsize=14)
plot!(-2:0.1:20, f1.(-2:0.1:20), color=:green, linewidth=3)
plot!(-2:0.1:20, f2.(-2:0.1:20), color=:red, linewidth=3)
plot!(-2:0.1:20, f3.(-2:0.1:20), color=:brown, linewidth=3)
plot!(-2:0.1:20, f4.(-2:0.1:20), color=:purple, linewidth=3)
plot!(gridlinewidth=1, gridalpha=0.75)
plot!(xticks=round(Int,xlims(p)[1]):round(Int,xlims(p)[2]), yticks=round(Int,ylims(p)[1]):round(Int,ylims(p)[2]))

scatter!(collect(Iterators.product(2:10, 3:13))[:], color=:black, markersize=5)
plot!(size=(600, 500))

Mixed-integer LPs: corners may not exist at integer points.

Solving MILPs

Example: Simple Mixed-Integer Linear Program

\[ \begin{align} \max \quad & 3x_1 + 4x_2 \\[0.5em] \text{subject to:} \quad & 2x_1 + 6x_2 \leq 27 \\[0.5em] & x_2 \geq 2 \\[0.5em] & 3x_1 + x_2 \leq 19 \\[0.5em] & x_1, x_2 \geq 0 \\[0.5em] & x_1, x_2 \quad \text{integers} \end{align} \]

Example: MILP

Example: MILP

Idea of Mixed-Integer Solution Method

Solution to linear relaxation (relax integer constraint to turn into an LP) is an upper bound on the mixed-integer solution (why?).

  1. Starting from this, test new problems “bounding” LP solution with integer constraints.

  2. Continue until integer solution found.

This is the branch and bound algorithm.

Branch and Bound: Node 1

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Branch and Bound Nodes 2 and 3

\[ \begin{align} \max \quad & 3x_1 + 4x_2 \\[0.5em] \text{subject to:} \quad & 2x_1 + 6x_2 \leq 27 \\ & x_2 \geq 2 \\ & 3x_1 + x_2 \leq 19 \\ & x_1, x_2 \geq 0 \\ & {\color{red}x_2 \leq 2} \qquad (\text{node}\, 2) \\ & {\color{blue}x_2 \geq 3} \qquad (\text{node}\, 3) \\ \end{align} \]

Example MILP: Nodes 2 and 3

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Nodes 4 and 5

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Nodes 6 and 7

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Branch and Bound

Branch and Bound Node 1

Example MILP: Nodes 8 and 9

Example MILP: Branch and Bound

Branch and Bound Node 1

Key Takeaways

Mixed Integer Problems

  • Integer/binary variables (e.g. from operational status) cause several violations of LP assumptions.
    • Non-linear/discontinuous objectives/constraints;
    • Loss of variable divisibility.
  • Can solve these problems with branch and bound (or more sophisticated refinements, such as branch and cut).
    • Search only useful refinements, ignore others.

Upcoming Schedule

Wednesday/Friday: Applications of MILP to solid waste management and maybe unit commitment.

Assessments

HW4/Regulatory Report: Due Friday by 9pm on Gradescope.