Week03 - Mathematical - Programming
Week03 - Mathematical - Programming
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
Are the values of the decision variables constrained in any way? "# , "$ Vehicles purchased Decision Variables
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
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
• 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
• 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
"%!&! , "%!&" , "%!&# , "%"&! , "%"&" , "%"&# , "%#&! , "%#&" , "%#&# ≥ 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?
#$#%# … #$$%$ 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, + ∈ &
• 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
%!! , %!" , %!# , %"! , %"" , %#" ,
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:
=
Set of nodes
;'
1 2 6
200 = .$#"# + .$%"#
1
300 -200 Cargo supply/demand on vertex i 1 4 2
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
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
"- ≤ 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