Chapter 14 Optimization I: Linear Optimization

In this chapter we will switch gears slightly to start talking about Prescriptive Analytics: that is, how to use analytics to make better decisions using data.

We’ll be discussing how to define certain problems as simple linear optimization problems: optimizing a given objective function, subject to certain linear constraints. We’ll cover how to use graphs to visualise and gain more intuition as to how to solve this problem. And finally, we will cover how to use R to solve the problem, as well as do additional sensitivity analyses.

The learning objectives for this chapter are:

  • Given an optimisation problem statement, readers should be able to properly identify an objective function and relevant constraints.

  • Readers should be familiar with linear optimisation concepts like the feasible region and finding optimal solutions as corner points of the feasible region.

  • Readers should be able to solve simple linear optimisation problems.

  • Readers should be comfortable in interpreting the results of the optimisation and of sensitivity analyses, and preparing a recommendation memo with justifications.

  • Readers should understand how and when integer constraints apply to optimisation problems.

  • Readers should know how to use Linear-Program Relaxation (LP Relaxation) to gain insight into integer-constrained problems.

  • Readers should understand how to solve integer-constrained optimisation problems.

# Load the libraries we'll use in this chapter
library(ggplot2) # for plotting
library(lpSolve) # for solving linear optimization problems ('linear programming')