Optimisation is the minimisation or maximisation of a function subject to constraints on its variables, we use the notation:

  • is the vector of variables (unknowns / parameters)
  • is the objective function, (scalar) function of that we want to maximise or minimise
  • and are constraint functions, scalar functions of that define certain equations and inequalities that the unknown vector must satisfy

A general form of an optimisation problem: subject to:

Linear Programming

Linear programming is the ‘planning of activities to obtain an optimal result’ given the objective function and constraints are linear. Solutions are highly structured and can be rapidly obtained.

A linear programming model consists of:

  • a set of decision variables
  • a (linear) objective function
  • a set of (linear) constraints

Algorithms for solving linear programming

  • Graphical method
  • Simplex method
  • Interior-point method

Commercial software packages: CPLEX, MINOS, GIPALS Open access packages: GLPK (GNU Linear Prog. Kit), LP Solve

We say a linear program is feasible if there is an assignment of values to variables that satisfies all constraints. Otherwise, it is infeasible. The set of all feasible solutions is called the feasible region.

A bounded region is an assignment of values to variables for that is the maximum (or minimum) among all feasible assignments (we call this the optimal solution). If a programme has some feasible solution, but no optimal solution, we call it unbounded.

Setting up a linear program

  1. Determine and label decision variables
  2. Determine objective and use decision variables to write an expression for the objective function
  3. Determine the constraints - feasible region
    1. Determine explicit constraints and write functional expression for each of them
    2. Determine implicit contraints (e.g. non-negativity constraints)

Graphical method to solve linear program

  1. Setup LP problem
  2. Construct the graph Plot the graph and constraint lines
  3. Identify feasible region Region of the graph that satisfies all constraints.
  4. Find optimum point

Example: Bakery Factory

Formulating as a Linear Program:

  1. Decision Variables : number of caramel cookies sold daily : number of chocolate chip cookies sold daily
  2. Objective Function
  3. Constraints

So our LP is Subject to the constraints listed above.

So we want to make 120 caramel cookies and 140 chocolate cookies to maximise profit. The maximum revenue generated in a day is £210.6

Example: no feasible solutions

Example: multiple optimal solutions

Example: unbounded region

Integer and mixed integer programming

When all variables are restricted to integer values (integer linear programming, ILP) then the problem is computationally hard: there are no polynomial time algorithms known.

While linear programming itself is easy and there are known polynomial time algorithms.

If we allow both real and integer variables (mixed integer linear programming, Mixed ILP) then the computational complexity grows with the number of integer variables.

A problem with a small (constant) number of binary variables may be computationally easy, but if the number of binary variables is a fixed fraction (e.g. 25%) of all variables, then the problem is NP-hard.

Example: Maximum Flow LP

Flow network

A flow network is a graph where:

  • is a set of nodes
  • is a set of edges (links)
  • For each , is the capacity of edge If , then for convenience we define
  • There are two distinguished nodes: source and sink where
Link to original

Maximum flow problem

The maximum flow problem is where for a given flow network, we find the flow of the maximum possible value (maximises net flow from source).

Link to original

Specific Example

Our decision variables are ( is flow on edge )

Maximise Subject to:

f_{a,b} + f_{a,s} - f_{c,a} &= 0 \\ f_{b,t} + f_{b,d} - f_{a,b} - f_{s,b} &= 0 \\ &\ldots \text{ are flow conservation constraints} \\ 0 \le f_{a,b} &\le 8 \\ 0 \le f_{c,a} &\le 4 \\ &\ldots \text{ are capacity constraints} \end{aligned}$$

General Approach Subject to:

Maximise

\sum_{v \in V} f_{uv} &= \sum_{v \in V} f_{uv} &&\text{ for each } u \in v - \{s,t\} \\ f_{uv} &\le h(u,v) &&\text{ for each } u,v \in V \\ f_{uv} &\ge 0 &&\text{ for each } u,v \in V \end{aligned}$$ **Objective function**: maximise net flow from the source **First set of constraints**: satisfy flow conservation for each node that is not the source nor the sink **Second set of constraints**: not allowing more flow through an edge than its capacity $h(u,v)$ **Third set of constraints**: making sure all flows are non-negative

A note on variables variables in our flow, with constraints. We may not be able to solve this with certain software (CPLEX is limited to no. of variables you can use), a good practice is to omit variables if .

We have

Example: Minimum-cost Flow LP

Minimum-cost flow problem

In the minimum-cost flow problem, we want to find a flow that satisfies all supply and demand and has the minimum possible cost. Formally, a flow in the network is a function assigning flows to edges, (non-negative amount of flow on edge to ), which satisfies the capacity constraints and flow conservation constraints.

The input is a flow network where:

  • is a set of nodes
  • is a set of directed edges
  • For each edge , is the capacity of edge We label each edge (x, y)
  • For each node , (as in flow-feasibility problem) is the (initial) supply (if ) or demand (if ) at . 1st number on each edge, x
  • For each edge , is the cost of one unit of flow on edge . 2nd number on each edge, y
Link to original

Specific Example

Our decision variables are ( is flow on edge )

Minimise Subject to:

f_{a,b} + f_{a,g} - f_{c,a} &= 8 \\ f_{p,e} - f_{b,p} - f_{d,p} &= -9 \\ &\ldots \text{ are flow conservation constraints} \\ 0 \le f_{a,b} &\le 8 \\ 0 \le f_{c,a} &\le 4 \\ &\ldots \text{ are capacity constraints} \end{aligned}$$

General Approach Subject to:

Minimise

\sum_{v \in V} f_{uv} - \sum_{v \in V} f_{vu} &= d(u) &&\text{for each } u \in V \\ f_{uv} &\le u(u,v) &&\text{for each } u,v \in V \\ f_{uv} &\ge 0 &&\text{for each } u,v \in V \end{aligned}$$ **Objective function**: minimise total cost of flow **First set of constraints**: satisfy flow conservation for each node $u$ with net flow $d(u)$; if $d(u) > 0$, we say $u$ is a source supplying $d(u)$ units; if $d(u) < 0$, we say that $u$ is a sink with a demand of $|d(u)|$ units of flow **Second set of constraints**: not allowing more flow through an edge than its capacity **Third set of constraints**: making sure all flows are non-negative

Numeric Optimisation

Slides 27 onwards simply introduce the next few topics.

May be worth copying some examples.

Local minima are global minima (in convex optimisation)

This fact will save us time.

1 item under this folder.