0% found this document useful (0 votes)
4 views12 pages

Week03 - Mathematical - Programming

Uploaded by

dossa2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views12 pages

Week03 - Mathematical - Programming

Uploaded by

dossa2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Values to be determined if we solve the problem.

As operations manager for a local school, you


have been asked to plan the renewal of the
DECISION VARIABLES Each is linked to quantifiable decisions
A simple decision problem school’s bus fleet.
• The school has a total of 600 students. Determine a purchase plan...
• The principal would like to have 10% spare capacity, to
account for a possible expansion.

Two bus models are under consideration:


• We define a decision variable to
• Model A can carry 23 students. Each vehicle costs
£210/week to own and operate. capture the numbers of vehicles
• Model B can carry 39 students. Each vehicle costs purchased from each category
£360/week to own and operate.
• At least 3 Model A buses should be purchased (for
transportation to small special events) x! Number of Model A vehicles
x" Number of Model B vehicles
Determine a purchase plan that minimises
costs.

PARAMETERS Known values used to describe the problem premise OBJECTIVE FUNCTION A performance measure against an optimisation goal

What information could we use to describe the problem? Is there an optimisation goal and metric?
The school has a total of 600 students. Yes -> Find a purchase plan that minimizes costs

The principal would like to have 10% spare capacity,


What is the metric?

...to account for a possible expansion.


How can we express the metric mathematically?
Model A can carry 23 students. Each vehicle
costs £210/week to own and operate.

Model B can carry 39 students. Each vehicle


costs £360/week to own and operate. What is the goal?

At least 3 Model A buses should be purchased

(for transportation to small special events)


Now put everything together:
The Blending Problem - Example
CONSTRAINTS Equations that restrict values of decision variables

Are the values of the decision variables constrained in any way? "# , "$ Vehicles purchased Decision Variables

Bus capacity must meet student demand plus spare capacity


23#! + 39#" ≥ 660 minimise 210"# +360"$ Objective Function

Minimum number of buses of type A subject to:


#! > 2
23"# + 39"$ ≥ 220 Constraint 1: Capacity Requirement
Nonnegativity of decision variables "# > 2 Constraint 2: Minimum Vehicles
#! , #" ≥ 0 "# , "$ ≥ 0 Constraint 3: Non-negativity

Decision variables are integers "# , "$ ∈ ℤ Constraint 4: Integer decision variables
#! , #" ∈ ℤ

Key Components of Mathematical Programming Model Values to be determined if we solve the problem.
DECISION VARIABLES Each is linked to quantifiable decisions
DECISION VARIABLES PARAMETERS
What does the problem ask? What decisions do we have to make?
Values to be determined if we solve How many decisions do we have to make?
Known values (constants) used to
the problem. Each is linked to
describe the problem premise
quantifiable decisions Determine the transportation arrangements
S1 D1
OBJECTIVE FUNCTION CONSTRAINTS We define a single decision variable for
flows on each link. S2 D2
A performance measure against a Equations describing restrictions on !!! "! , !!! "" , !!! "# , !!" "! , !!" "" , !!" "# ,
specific optimisation goal decision variables values !!# "! , !!# "" , !!# "#
S3 D3
PARAMETERS Known values used to describe the problem premise OBJECTIVE FUNCTION A performance measure against an optimisation goal

What information could we use to describe the problem? Is there an optimization goal?
“…the firm has three production sites, Determine the transportation arrangements
“…the cost of transporting goods…”
used to serve demand…”
Not really. How would we decide where to source materials from?
Segment Travel Cost
Station Supply/Demand S1 à D1 6
“…the cost of transporting goods among the 6 sites…”
Rates S1 à D2 3
S1 300 We could therefore propose and use the following objective:
S1 à D3 8
S2 300 S2 à D1 7 Determine the set of flows with
S3 100 S2 à D2 5 the minimum overall transportation cost
D1 -200 S2 à D3 9
D2 -200 minimize
S3 à D1 4
D3 -300 S3 à D2 5 6"%!&! +3"%!&" + 8"%!&# +7"%"&! +5"%"&" +9"%"&# +4"%#&! + 5"%#&" +5"%#&#
S3 à D3 5

PUTTING IT ALL TOGETHER


CONSTRAINTS Equations that restrict values of decision variables
Decision
!!! "! … !!# "# Flow quantity
Are the values of the decision variables constrained in any way? Variables

supply and demand limitations at each site Objective


minimize 6"!!"! +3"!!"" + 8"!!"# +7"!""! +5"!""" +9"!""# +4"!#"! + 5"!#"" +5"!#"#
Function
300 units/day
300 = $!!"! + $!!"" + $!!"# 300 = ##! $! + ##! $" + ##! $#
200 units/day Constraints
subject to 200 = '!! "! + '!" "! + '!# "!
S1 D1 Supply
200 = $!!"! + $!""! + $!#"! 300 = ##" $! + ##" $" + ##" $# 200 = '!! "" + '!" "" + '!# "" Limits

300 = $!""! + $!""" + $!""# 300 units/day 200 units/day 100 = ### $! + ### $" + ### $# 300 = '!! "# + '!" "# + '!# "# Demand
Limits
200 = $!!"" + $!""" + $!#"" S2 D2
"%!&! , "%!&" , "%!&# , "%"&! , "%"&" , "%"&# , "%#&! , "%#&" , "%#&# ≥ 0 Non-Negativity
100 = $!#"! + $!#"" + $!#"# 100 units/day
300 units/day The above is a formal presentation of the mathematical model that describe the
300 = $!!"# + $!""# + $!#"# S3 D3 problem. You should endeavour to present all your models in this way
Constructing an LP graph Constructing an LP graph
min #% + #& min #% + #&
2#% + 3#& ≥ 6 '% 2#% + 3#& ≥ 6 '%
−#% + 2#& ≤ 2 −#% + 2#& ≤ 2
5#% + #& ≥ 10 5#% + #& ≥ 10

• Each axis corresponds to a decision • The three lines collectively define the
variable. feasible space that should contain the
• Each inequality corresponds to a half plane. solution.
• To determine the cut-of lines of the planes, • To identify the optimum solution, we also
equate each variable with 0, in turn. need to define a line for the objective, using
'$ constant equality '$

• 2"' + 3"( ≥ 6: "' = 0 → "( = 2 "( = 0 → "' = 3 • Using "' + "( = 1: "' = 0 → "( = 1 "( = 1 → "' = 0
• −"' + 2"( ≤ 2: "' = 0 → "( = 1 "( = 0 → "' = −1 • We move this line inside the feasible space
• 5"' + "( ≥ 10: "' = 0 → "( = 10 "( = 0 → "' = 2

Constructing an LP graph Constructing an LP graph


min #% + #& '%
2#% + 3#& ≥ 6 '%
−#% + 2#& ≤ 2 Corner Point Value
5#% + #& ≥ 10 '$ = 3.0, '% = 0.0 3+0= 3

• With the objective function line within the '$ = 1.6, '% = 1.8 1.6 + 1.8 = 3.4

region of feasibility, we will move it again in '$ = 1.8, '% = 0.7 1.8 + 0.7 = 2.6

accordance to the direction of search.


• The optimal solution will be the last to be
encountered by the line before it exits the '$
space '$

• What if the objective was a maximization • Alternatively, you can enumerate all the vertices (corner points) of the feasible
à Unbounded region. These are called feasible corner points.
• What if there was no feasible space (all constraints mutually exclusive) • For each of these you can evaluate the value of the objective function.
à Infeasible • The one that meets the objective (maximize, minimize) is the optimum.
Mathematical Models – Explicit Form Shortcomings of explicit form representation

• Parameter values are provided without comment.


!!! "! … !!# "# Flow quantity
• Readers must look up or recall the meaning of each number.
minimize 6"!!"! +3"!!"" + 8"!!"# +7"!""! +5"!""" +9"!""# +4"!#"! + 5"!#"" +5"!#"# • Impractical for larger models.
• Easy to make mistakes.
subject to 300 = ##! $! + ##! $" + ##! $# 200 = ##! $! + ##" $! + ### $!
300 = ##" $! + ##" $" + ##" $# 200 = ##! $" + ##" $" + ### $"
• Minor changes in values would require rewriting the model
100 = ### $! + ### $" + ### $# 300 = ##! $# + ##" $# + ### $#

"%!&! , "%!&" , "%!&# , "%"&! , "%"&" , "%"&# , "%#&! , "%#&" , "%#&# ≥ 0 When specifying mathematical
models, seek to use variable
The above model is a correct representation of a transportation problem names for each parameter.
instance. Is it however practical?

Mathematical Models – Symbolic Form Commentary of symbolic form representation

#$#%# … #$$%$ Flow quantity • Definitely an improvement over the explicit form
$$#%# … $$$%$ Transportation Cost
• Common convention is to use lowercase letters for decision variables
SEPARATELY DEFINE
and uppercase letters for parameter values.
&$# … &%$ Station Demand PARAMETER VARIABLES
However…
minimize $$#%# #$#%# + $$#%% #$#%% + $$#%$ #$#%$ + $$%%# #$%%# + $$%%% #$%%%
+ $$%%$ #$%%$ + $$$%# #$$%# + $$$%% #$$%% + $$$%$ #$$%$ • Still inflexible – what happens if the
subject to 4#! = ##! $! + ##! $" + ##! $# 4#" = ##" $! + ##" $" + ##" $#
size of the problem changes?
4$! = ##! $! + ##" $! + ### $! 4$" = ##! $" + ##" $" + ### $" • Repetition, especially in large models.
44# = ### $! + ### $" + ### $# 4$# = ##! $# + ##" $# + ### $#
Use sets of symbols to reduce
##! $! , ##! $" , ##! $# , ##" $! , ##" $" , ##" $# , ### $! , ### $" , ### $# ≥ 0
formulation complexity
Mathematical Models – Indexed-Symbolic Form A closer look…
0 Set of supply nodes in the network “Sum the products of costs
&
We define sets
Set of demand nodes in the network minimize - - $&' #&' and flows for all links ($, %)
& ∈% *∈&
#&' Flow on link (), +) that connect nodes S to D”
$&' Cost of transport on link (), +) Variable and parameter
.& Cargo supply in node ) definitions now use - #&' = /' ∀ j ∈ D
“Create an instance of this
/& Cargo demand in node ) component sets &∈$
constraint for each node %
within the set of nodes '”
minimize - - $&' #&'
& ∈% *∈&
“Sum the flows of all links $, %
subject to - #&' = .& ∀ ) ∈ S - #&' = /' ∀ j ∈ D
'∈%
arriving to the specific node (
&∈$
from any source i”
0 ≤ #&' ∀) ∈ 0, + ∈ &

Mathematical Models – Indexed-Symbolic Formulation Formulations and instances


5 6&( '&(
- - $&' #&'
minimize
N: 1, 2, 3
minimize
& ∈% *∈&
&,( ∈ *
*!! = 6, *!" = 3, *!# = 8, *"! = 7, c"" = 5,
subject to 5 '&( = 7( , ∀ 9 ∈ ; 6&( :
c"# = 9, c#! = 4, c#" = 5, c## = 5

- #&' = .& ∀ ) ∈ S - #&' = /' ∀ j ∈ D


&∈ *
subject to 7( : 3! = 200, 3" = 200, 3# = 300
5 '&( = <& , ∀ = ∈ ;
&∈$
'∈% (∈ * <& 5! = 300, 5" = 300 5# = 100
'&( ∈ 0,1 , ∀ =, 9 ∈ ;
0 ≤ #&' ∀) ∈ 0, + ∈ &
A symbolic problem A problem instance (the data)
The indexed-symbolic form is an abstract mathematical recipe that: formulation (the recipe) $!! %!! + $!" %!" + $!# %!# +
minimize $"!%"! + $""%"" + $"#%"# +
$#! %#! + $#" %#" + $## %##

• Captures relationships between known and unknown variables (constraints) %!! + %"! + %#! = 200
subject to %!" + %"" + %#" = 200
%!# + %"# + %## = 300
• Defines the direction of search for an optimal value (the objective function) What will be solved %!! + %!" + %!# = 300
%"! + %"" + %"# = 300
• Will describe any instance of the same problem, irrespective of size. by an algorithm %#! + %#" + %## = 100
%!! , %!" , %!# , %"! , %"" , %#" ,

(the explicit model) !!", !!#, !!! ∈ 0,1


Revisiting the blending problem The Blending Problem – Indexed-Symbolic Formulation
0 Set of vehicle types
"# , "$ Vehicles purchased Decision Variables #& Number of vehicles of type ) that have been purchased
$& Cost of vehicle of type )
minimise 210"# +360"$ Objective Function
9& Minimum number of vehicles to be purchased from type )
subject to: : Capacity requirement
23"# + 39"$ ≥ 660
- :+ #&
Constraint 1: Capacity Requirement
"# > 2
minimize
& ∈%
Constraint 2: Minimum Vehicles
"# , "$ ≥ 0 Constraint 3: Non-negativity
subject to - #& > :
"# , "$ ∈ ℤ Constraint 4: Integer decision variables
&∈$
#& ≥ 9& ∀7 ∈8
#& > 0 ∀) ∈ 0

Decision Variables
Depending on the nature of the model we may have to use a different
type of decision variable (DV). Common types include:
The decisions to be made can be represented using continuous values (ie. 0.76,
LINEAR 1.23, -124.23). Can take any value in a specified interval.
Refer to the abstract problem in the geometric method video.

Only integer values can be used to capture decisions. Used to model countable
INTEGER or fixed set of values.
(discrete) Refer to the school bus fleet model.
Part 5
Mostly used for true/false decisions – effectively an integer variable with
BOOLEAN variables restricted to 0 and 1.
MODEL TYPES
Objective Functions Objective Functions
The objective function used in a model reflects the optimization goals The objective function used in a model reflects the optimization goals of the
of the problem that we seek to solve. Some common types include: problem that we seek to solve. Some common types include:

SINGLE SINGLE MULTIPLE


This is the most common type of objective function. Such OF would ask us to Multi-objective optimization is used when several objectives apply. Such models
maximize or minimize the value of an expression. No difference exists between the may have common constraints, but many objective functions, each pulling the
two, since: problem to a different direction.
max < " ⟺ min −<(")
A common approach is to seek a new function that combines all aspects of the
Examples: problem.
(
@ABA@ACD "' + "( − 2 @ABA@ACD "' + "( − 2 ( and @E"A@ACD ∑* E+ G* ⇒
@E"A@ACD F E+ G* (
@ABA@ACD J "' + "( − 2 − B F E+ G*
* *

Objective Functions Common model categories


The objective function used in a model reflects the optimization goals of the Linear Programs (LP) ;7:7;7<= 2# + L
problem that we seek to solve. Some common types include: (objective/constraints are linear formulas, variables are Real #, L: Real

SINGLE MULTIPLE MAXIMIN/MINIMAX Integer Programs (IP) ;>#7;7<= # + 5L


(all decision variables are integers, formulas are linear) # ∈ 1,2, … 5 , L ∈[0.1]
One possible objective function that you might encounter might be: Mixed Integer Linear Programs (MILP) ;7:7;7<= 2# − 5L
97:7;7<= 9>#7;?; @ >?> #> (linear programs, mix of integer and linear decision variables) #: Real, L ∈ 5,6, … 10
>
Quadratic Programs (QP) ;7:7;7<= # + L &
This is referred to as a minimax objective. Example: Minimize the largest trip made
by a vehicles in a fleet that serve a single area. (quadratic objective function, linear constraints) #, L: Real
An entire ecosystem of variations & combinations:
Such constraints could be converted into a classical objective function:
ie. Mixed Integer Linear Programs (MILP), Binary Integer Programs (BIP), Quadratically Constrained
Minimize < Quadratic Programs (QCQP), Mixed Integer Quadratically Constrained Programs (MIQCP), etc..
subject to ∑> >?> #> − < ≤ 0
Transhipment Problem Formulation Transhipment – Explicit formulation
.!#$# … .$%"& Flow quantity S1 D1

2.!#$# + .!#$% + .!%$#


S1 D1
+ 2.!%$% + .!&$# + 2.!&$%
minimize S2 W1 D2
W1 + .$#"# + 2.$#"% + .$#"&
S2 D2
+ 2.$%"# + .$%"% + 2.$%"&
S3 D3

300 = .!#$# + .!#$%


S3 D3 subject to
300 = .!%$# + .!%$%
"%',' + "%(,' + "%-,' = ",'&' + ",'&( + ",'&- 100 = .!&$# + .!&$#
200 = .$#"# + .$%"#
300 -200

200 = .$#"% + .$%"% S1 2 D1


300 = .$#"& + .$%"&
1
1 W1 2
300 1
-200
1
• Flow-conservation: enforcing a balance between inflows and outflows. S2 2 2 D2
'+$,$ + '+%,$ + '+-,$ = ',$.$ + ',$.% + ',$.-
• Also referred to as a transhipment constraint in logistics/OR literature 100 1
W2 1
-300
'+$,% + '+%,% + '+-,% = ',%.$ + ',%.% + ',%.- 2
• Transhipment points in a supply chain network could represent cross-dock S3 2 D3

'+$,% , '+%,% , '+-,% , ',%.$ , ',%.% , ',%.- ≥ 0


operations, consolidation centres. '+$,$ , '+%,$ , '+-,$ , ',$.$ , ',$.% , ',$.- ,

Transhipment – Explicit formulation Transhipment – Symbolic formulation


.!#$# … .$%"& Flow quantity Symbol
S1 D1 • The modified representation of the network allows us to use a significantly
definitions
2.!#$# + .!#$% + .!%$#
simpler model formulation.
+ 2.!%$% + .!&$# + 2.!&$%
minimize S2 W1 D2
• A single constraint now captures production, consumption and transhipment
+ .$#"# + 2.$#"% + .$#"&
Objective
+ 2.$%"# + .$%"% + 2.$%"& <
function S3 D3

=
Set of nodes

300 = .!#$# + .!#$%


Set of transportation links
.') Flow of goods between 8, :
subject to
300 = .!%$# + .!%$%
Enforce supply Symbol

100 = .!&$# + .!&$# 7') Cost of transport on arc 8, :


limits definitions 300 -200

;'
1 2 6
200 = .$#"# + .$%"#
1
300 -200 Cargo supply/demand on vertex i 1 4 2

200 = .$#"% + .$%"%


300 -200
6 7') .')
1
Enforce S1 2 D1 Objective 1

300 = .$#"& + .$%"&


1 2 2 2 7
demand limits 300
1 W1 2 -200 minimize function 5 1
1 1 ',) ∈+ 100 1 -300
2
S2 D2
6 .') − 6 .-' = ;' ∀ 8 ∈ <
2 2
'+$,$ + '+%,$ + '+-,$ = ',$.$ + ',$.% + ',$.- 3 2 8
Flow W2 1 Constraint 1
100 1 -300 subject to
'+$,% + '+%,% + '+-,% = ',%.$ + ',%.% + ',%.- conservation 2
2
): ',) ∈+ ): -,' ∈+
Flow Conservation
S3 D3
0 ≤ .') ∀8, : ∈ =
'+$,% , '+%,% , '+-,% , ',%.$ , ',%.% , ',%.- ≥ 0
'+$,$ , '+%,$ , '+-,$ , ',$.$ , ',$.% , ',$.- , Non- Constraint 2
Non-Negativity
negativity
A closer look… Shortest Path Problems – Abstract Formulation
<
6 .') − 6 .-' = ;' ∀ 8 ∈ < =
“Create an instance of this constraint for Set of vertices B E
3
each node N within the set O” Set of links in the network
.') Flow on arc (8, :)
):(',))∈+
5
-: -,' ∈+

7') Cost of transport on arc (8, :)


A 1 4 2 4
“Sum the flows of all arcs P, N
directed towards a specific node 7 C Source node (part of <)
“Sum the flows of all arcs N, Q D Terminal node (part of <)
2
8 2
departing from a specific node 7
C D F

minimize 6 7') .') Objective


The same constraint applies for all three types of echelon connectivity ',) ∈+ Same as before • Minor modifications were on
constraints.

subject to 6 .') − 6 .)' = ;' ∀ 8 ∈ < Constraint 1 • These ensure that flows
300 2 -200 Same as before

1, for 8 = C
1 ): ',) ∈+ -: -,' ∈+ indicate a single route.
2 1
;0 = E−1 for 8 = D
Constraint 2
1 1 4 2
0 otherwise
Convenient approach, but
6 Defines endpoints •
not computationally efficient
.') ∈ {0,1} ∀ (8, :) ∈ =
1 1 1 2 Constraint 3
Boolean flows

The Knapsack Problem – Explicit Model The Knapsack Problem – Symbolic Model
0 Set of product types
"' , "( , "- , "O Quantity of each type of item Decision #& Number of items from each type
=& Revenue from each unit of type )
Variables

maximise 1000"' +7000"( + 3000"- + 250xO


Objective >& Weight of each unit of type )
Function
:& Volume of each unit of type )
Constraints
subject to >)*+ Total weight capacity of the truck
50"' + 450"( + 100"- + 20"O ≤ 16200 Weight capacity :)*+ Total volume capacity of the truck

0.4"' + "( + 2"- + 0.1"O ≤ 32 Volume capacity


- M+ #&
maximize
"' , "( , "- , "O ≥ 0 & ∈%
Non-Negativity

"' , "( , "- , "O ∈ ℤ Integrality


subject to - >& #& ≤ >)*+ - :& #& ≤ :)*+
&∈$ &∈$
#& ≥ 0 ∀7 ∈8 #? ∈ ℤ ∀) ∈ 0
The Covering Problem - Example The Covering Problem – Explicit Model
• The ambulance service would like to determine the location of new ambulance "' , "( , "- Is a station opening in a specific location? Decision
stations, to provide coverage across the various city neighborhoods. G' , G( , G- , GO , GP Is an area covered by a station? Variables

5"' + 10"( + 3"-


Objective
• The goal is to minimise the total cost, while covering all the 5 areas in the city. minimise Function
• There are 3 possible locations (L1, L2, L3), and all could be used if necessary. subject to Constraints
The cost of establishing a station in each location is: "' ≤ G' If "' is active, then G' , G- , GO are covered
Cost(L1) = £5M "' ≤ G- • If "' = 1, then G' , G- , GO = 1 Location-area
Cost(L2) = £10M "' ≤ GO • If "' = 0, then G' , G- , GO can still be relationships

Cost(L3) = £3M covered, through other stations


• Each location can cover different neighborhoods, as follows:
L1 can cover areas A1, A3 and A4.
L2 can cover areas A2 and A5.
L3 can cover areas A1, A2, A3 and A4.

The Covering Problem – Explicit Model The Covering Problem – Explicit Model
"' , "( , "- Is a station opening in a specific location? Decision "' , "( , "- Is a station opening in a specific location? Decision
G' , G( , G- , GO , GP Is an area covered by a station? Variables G' , G( , G- , GO , GP Is an area covered by a station? Variables

5"' + 10"( + 3"- 5"' + 10"( + 3"-


Objective Objective
minimise Function minimise Function
Constraints Constraints
subject to subject to
"' ≤ G' G' ≤ "' + "- "' ≤ G' "( ≤ G( "- ≤ G' G' ≤ "' + "-
"' ≤ G- "' ≤ G- "( ≤ GP "- ≤ G( G( ≤ "( + "-
"' ≤ GO Location-area
"' ≤ GO "- ≤ G- G- ≤ "' + "-
Location-area

"- ≤ GO
relationships relationships
G' will not be covered if stations in range are not open. GO ≤ "' + "-
• If G' = 1, then at least "' or "- should be 1. GP ≤ "(
• This constraint, on its own, allows for G' = 0 if "' or G' = 1 G( = 1 G- = 1 GO = 1 GP = 1 Area Coverage
"- are 1.
• However, the other set of constraints preclude this. "' , "( , "- , G' , G( , G- , GO , GP ∈ {0,1} Binary
The Covering Problem – Symbolic Model
? Set of station locations
9 Set of neighbourhoods
#& Is a station ) ∈ ? opening in a specific location?
@' Is a neighbohood + ∈ 9 covered?
A&' Is a neighborhood + ∈ 9covered by station ) ∈ ??
$& Cost of opening station ) ∈ ?

minimize - :+ #&
& ∈Q

subject to >?> #? ≤ L> ∀7 ∈ R, S ∈ T


L> ≤ ∑?∈@ >?> #? ∀ S ∈ T
L> = 1 ∀S ∈ T
#? ∈ 0,1 ∀7 ∈ R, L> ∈ 0,1 ∀S ∈ T

You might also like