Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Lab Section

¨ Excel Solver: Capacitated Plant Location Model


¨ Lingo:
¨ Lingo Model Components
¨ Transportation problem
¨ Assignment problem
1. Capacitated Plant Location Model
n = number of potential plant locations/capacity
m = number of markets or demand points y=i 1 if plant i is open, 0 otherwise
Dj = annual demand from market j xij = quantity shipped from plant i to
K i = potential capacity of plant i market j

fi = annualized fixed cost of keeping plant i open


cij = cost of producing and shipping one unit from plant i to market j (cost includes production,
inventory, transportation, and tariffs)
n n m
Minå fi yi + å åcx ij ij
i=1 i=1 j=1

subject to n

åx ij
=Dj for j =1,...,m
i=1
m

åx ij
=K i yi for i =1,...,n
j=1

yi Î { 0,1} for i =1,...,n, x ij ³ 0


Network Optimization Model
Capacitated Plant Location Model
Capacitated Plant Location Model
Capacitated Plant Location Model
Excel Solver Model
Excel Solver Results
2. The LINGO Computer Package
¨ LINGO is a user friendly computer package that can be used to
solve linear, integer, and nonlinear, stochastic programming
problems.
¨ LINGO assumes all variables are nonnegative
¨ View the LINGO Help file for syntax questions
¨ View the LINGO examples for studying different cases
¨ To solve the model, select the SOLVE command or click the red
bulls eye button.
¨ Some useful settings in OPTIONS
MODELING ON LINGO
¨ The first statement in a LINGO model is
MODEL:

END
¨ The objective function will be represented by MAX or MIN
commands to solve a maximization or minimization problem.
¨ Enter the constraints by typing directly on the next line.
¨ Ending command line in LINGO is “;” mark. The “!” mark is used for
comments.

10
Example 1

11
The Outputs
¨ The optimal z-value = 280
¨ VALUE gives the value of the
variable in the optimal LP
solution. Thus the optimal
solution calls for production of 2
desks, 0 tables, and 8 chairs.
¨ SLACK OR SURPLUS gives
(by constraint row) the value of
slack or excess in the optimal
solution.
¨ REDUCED COST gives the
coefficient in row 0 of the
optimal tableau (in a max
problem). The reduced cost of
each basic variables must be 0.
Reduced cost is the amount the objective function coefficient for
variable i would have to be increased for there to be an
alternative optimal solution. 12
Shadow Prices
¨ Shadow prices are shown in the Dual Prices section of LINGO output.
¨ Shadow prices are the amount the optimal z-value improves if the rhs of a
constraint is increased by one unit (assuming no change in basis).
¨ ³ constraints: nonpositive shadow prices.
¨ £ constraints: nonnegative shadow prices.
¨ = constraints: a positive, a negative, or 0 shadow price.
¨ For any inequality constraint, the product of the values of the constraint’s
slack/excess variable and the constraint’s shadow price must equal zero.
¨ This implies that any constraint whose slack or excess variable > 0 will have
a zero shadow price.
¨ Similarly, any constraint with a nonzero shadow price must be binding (have
slack or excess equaling zero).
¨ For constraints with nonzero slack or excess:

Type of Constraint Allowable Increase for Allowable Decrease for rhs


rhs
≤ ∞ = value of slack
2.1. LINGO Model Components

Variables & parameters


definition
Objective function

Constraints

Input Data
14
2.2. Transportation Problem

¨ A transportation problem basically deals with the


problem, which aims to find the best way to fulfill
the demand of n demand points using the
capacities of m supply points.
¨ While trying to find the best way, generally a
variable cost of shipping the product from one
supply point to a demand point or a similar
constraint should be taken into consideration.
Example 2: ABC-Delivery Company

¨ ABC-Delivery has three warehouses that supply


the coffee needs of retailers (customers).
¨ The associated supply of each warehouse and
demand of each customer is given in the Table
1.
¨ The cost of sending 1000 boxes of coffee from a
warehouse to a customer depends on the
travelling distance
Ex. 2 - continued
¨ A transportation problem is specified by the
supply, the demand, and the shipping costs.
Relevant data can be summarized in a
transportation tableau.
From To
C1 C2 C3 C4 Supply
(1000 boxes)
WH 1 $8 $6 $10 $9 35
WH 2 $9 $12 $13 $7 50
WH 3 $14 $9 $16 $5 40
Demand 45 20 30 30
(1000 boxes)
Example 2: Solution
¨ Decision Variables
¨ ABC must determine how much coffee is sent from each
warehouse to each customer so xij = Amount of coffee stocked
at warehouse i and sent to customer j
¨ x14 = Amount of coffee stocked at warehouse 1 and sent to customer 4
¨ Constraints
¨ A supply constraint ensures that the total quality stocked does
not exceed warehouse capacity. Each warehouse is a supply
point.
¨ A demand constraint ensures that a location receives its
demand. Each customer/retailer is a demand point.
¨ Since a negative amount of coffee can not be shipped all xij’s
must be non negative
LP Formulation
Min Z =
8x11+6x12+10x13+9x14+9x21+12x22+13x23+7x24+14x31+9x32+16x33+5x34

S.T.: x11+x12+x13+x14 <= 35 (Supply Constraints)


x21+x22+x23+x24 <= 50
x31+x32+x33+x34 <= 40

x11+x21+x31 >= 45 (Demand Constraints)


x12+x22+x32 >= 20
x13+x23+x33 >= 30
x14+x24+x34 >= 30
xij >= 0 (i= 1,2,3; j= 1,2,3,4)
¨ In general, a transportation problem is specified by
the following information:
¨ A set of m supply points from which a good is shipped.
Supply point i can supply at most si units.
¨ A set of n demand points to which the good is shipped.
Demand point j must receive at least di units of the
shipped good.
¨ Each unit produced at supply point i and shipped to
demand point j incurs a variable cost of cij.
¨ xij = number of units shipped from supply point i
to demand point j
i m j n
min  cijXij
i 1 j 1
j n
s.t. Xij  si (i  1,2,..., m)
j 1
i m

X
i 1
ij  dj ( j  1,2,..., n)

Xij  0(i  1,2,..., m; j  1,2,..., n)


The Lingo Model of The
Transportation Problem

22
Transportation Problem
i m j n Characteristics
¨ If  si   dj then total supply equals to total demand, the problem is
i 1 j 1
said to be a balanced transportation problem.
¨ If total supply exceeds total demand, we can balance the problem by
adding dummy demand point. Since shipments to the dummy demand
point are not real, they are assigned a cost of zero.
¨ If a transportation problem has a total supply that is strictly less than total
demand the problem has no feasible solution.
¨ No doubt that in such a case one or more of the demand will be left
unmet.
¨ Generally in such situations a penalty cost is often associated with
unmet demand and as one can guess the total penalty cost is desired
to be minimum.
¨ The basic solution method for a balanced TP is the Northwest Corner
Method
2.3. Assignment Problems
¨ In general an assignment problem is balanced
transportation problem in which all supplies and
demands are equal to 1.
¨ The assignment problem’s matrix of costs is its cost
matrix.
¨ All the supplies and demands for this problem are
integers which implies that the optimal solution must
be integers.
¨ The Hungarian Method is usually used to solve
assignment problems.
Example 3: Machine Assignment Problem
¨ Machineco has four jobs to be completed.
¨ Each machine must be assigned to complete one job.
¨ The time required to setup each machine for completing
each job is shown.
Time (Hours)

Job1 Job2 Job3 Job4

Machine 1 14 5 8 7

Machine 2 2 12 6 5

Machine 3 7 8 3 9

Machine 4 2 4 6 10
¨ Machineco wants to minimize the total setup time needed to
complete the four jobs.
Solution
¨ Machineco must determine which machine should be assigned to
each job.
¨ i,j=1,2,3,4
¨ xij=1 (if machine i is assigned to meet the demands of job j)
¨ xij=0 (if machine i is not assigned to meet the demands of job j)
min Z  14 X 11  5 X 12  8 X 13  7 X 14  2 X 21  12 X 22  6 X 23  5 X 24
 7 X 31  8 X 32  3 X 33  9 X 34  2 X 41  X 42  6 X 43  10 X 44
s.t. X 11  X 12  X 13  X 14  1 (Machine constraint s)
X 21  X 22  X 23  X 24  1
X 31  X 32  X 33  X 34  1
X 41  X 42  X 43  X 44  1
X 11  X 21  X 31  X 41  1 (Job constraint s)
X 12  X 22  X 32  X 42  1
X 13  X 23  X 33  X 43  1
X 14  X 24  X 34  X 44  1
Xij  0orXij  1
LINGO Model

27

You might also like