Lab Section: Excel Solver: Capacitated Plant Location Model Lingo
Lab Section: Excel Solver: Capacitated Plant Location Model Lingo
subject to n
åx ij
=Dj for j =1,...,m
i=1
m
åx ij
=K i yi for i =1,...,n
j=1
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:
Constraints
Input Data
14
2.2. Transportation Problem
X
i 1
ij dj ( j 1,2,..., n)
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)
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