0% found this document useful (0 votes)
2 views61 pages

Lecture 4 - Computer Application to LP (2020)

The document provides guidelines for model formulation in linear programming, emphasizing the importance of understanding the problem, defining decision variables, and formulating objective functions and constraints. It includes an example involving Olympic Bike Co., detailing the production of two bicycle frames and the associated costs, constraints, and optimal solutions. Additionally, it discusses concepts such as sensitivity analysis, shadow prices, and dual prices, highlighting their relevance in decision-making under uncertainty.
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)
2 views61 pages

Lecture 4 - Computer Application to LP (2020)

The document provides guidelines for model formulation in linear programming, emphasizing the importance of understanding the problem, defining decision variables, and formulating objective functions and constraints. It includes an example involving Olympic Bike Co., detailing the production of two bicycle frames and the associated costs, constraints, and optimal solutions. Additionally, it discusses concepts such as sensitivity analysis, shadow prices, and dual prices, highlighting their relevance in decision-making under uncertainty.
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/ 61

Guidelines for Model Formulation

 Understand the problem thoroughly.


 Write a verbal statement of the objective function and each
constraint.
 Define the decision variables.
 Write the objective function in terms of the decision
variables.
 Write the constraints in terms of the decision variables.

Compiled by Nurhadi Siswanto 1

A Note on Sunk Cost and Relevant Cost


 A resource cost is a relevant cost if the amount paid for it is
dependent upon the amount of the resource used by the decision
variables.

 Relevant costs are reflected in the objective function coefficients.

 A resource cost is a sunk cost if it must be paid regardless of the


amount of the resource actually used by the decision variables.

 Sunk resource costs are not reflected in the objective function


coefficients.

Compiled by Nurhadi Siswanto 2

1
Example: Olympic Bike Co.

Olympic Bike is introducing two new


lightweight bicycle frames, the Deluxe and the
Professional, to be made from special aluminum
and steel alloys. The anticipated unit profits are
$10 for the Deluxe and $15 for the Professional.

Compiled by Nurhadi Siswanto 3

Example: Olympic Bike Co.

The number of pounds of each alloy needed


per frame is summarized below. A supplier
delivers 100 pounds of the aluminum alloy and 80
pounds of the steel alloy weekly. How many
Deluxe and Professional frames should Olympic
produce each week?

Aluminum Alloy Steel Alloy


Deluxe 2 3
Professional 4 2
Compiled by Nurhadi Siswanto 4

2
Example: Olympic Bike Co.

 Model Formulation
• Verbal Statement of the Objective Function
Maximize total weekly profit.

• Verbal Statement of the Constraints


Total weekly usage of aluminum alloy < 100 pounds.
Total weekly usage of steel alloy < 80 pounds.

• Definition of the Decision Variables


x1 = number of Deluxe frames produced weekly.
x2 = number of Professional frames produced weekly.
Compiled by Nurhadi Siswanto 5

Example: Olympic Bike Co.


 Model Formulation (Continued)

Max 10x1 + 15x2 (Total Weekly Profit)

s.t. 2x1 + 4x2 < 100 (Aluminum Available)


3x1 + 2x2 < 80 (Steel Available)

x1, x2 > 0

Compiled by Nurhadi Siswanto 6

3
Solved by POM Software

Step 1

Click start button and select POM for Windows button

Compiled by Nurhadi Siswanto 7

Solved by POM Software

Step 2
- Choose Linear Programming
Module

- Click New for writing new formulation

Compiled by Nurhadi Siswanto 8

4
Solved by POM Software

Step 3
- Type the title of the problem, number of constraints and variables
- Choose type of objective function
- Choose format of the constraints’ name

Compiled by Nurhadi Siswanto 9

Solved by POM Software

Step 4
- Input the formulation to the POM Software
Max 10x1 + 15x2 (Total Weekly Profit)
s.t. 2x1 + 4x2 < 100 (Aluminum Available)
3x1 + 2x2 < 80 (Steel Available)
x1, x2 > 0

Compiled by Nurhadi Siswanto 10

10

5
Solved by POM Software

Step 5
- Solve the formulation by clicking Solve Button

Compiled by Nurhadi Siswanto 11

11

Solved by POM Software

Step 6
- Interpret the result

Compiled by Nurhadi Siswanto 12

12

6
Solved by POM Software

Step 7
- The graph can be displayed by maximizing Graph window

Compiled by Nurhadi Siswanto 13

13

Standard Computer Output


LP software packages, provide the following information
about the optimal solution:

• Optimal value of the objective function

• Information about the decision variables:


their optimal values

their reduced costs


• Information about the constraints:


the amount of slack or surplus

the dual prices


Compiled by Nurhadi Siswanto 14

14

7
Standard Computer Output

LP software packages, also provide the following


information about the optimal solution:

• Objective function coefficient ranges (ranges of


optimality)

• Right-hand side ranges (ranges of feasibility)

Compiled by Nurhadi Siswanto 15

15

Example: Olympic Bike Co.


 Computer Output

OBJECTIVE FUNCTION VALUE = 412.500

Variable Value Reduced Cost


x1 15.000 0.000
x2 17.500 0.000

Constraint Slack/Surplus Dual Price


1 0.000 3.125
2 0.000 1.250

Compiled by Nurhadi Siswanto 16

16

8
Example: Olympic Bike Co.
 Computer Output (Continued)

OBJECTIVE FUNCTION RANGES


Variable Lower Limit Current Value Upper Limit
x1 7.500 10.000 22.500
x2 6.667 15.000 20.000

RIGHTHAND SIDE RANGES


Constraint Lower Limit Current Value Upper Limit
1 53.333 100.000 160.000
2 50.000 80.000 150.000

Compiled by Nurhadi Siswanto 17

17

Example: Olympic Bike Co.


 Optimal Solution

According to the output:


x1 (Deluxe frames) = 15,
x2 (Professional frames) = 17.5, and
the objective function value = $412.50.

Compiled by Nurhadi Siswanto 18

18

9
Sensitivity Analysis
 Sensitivity analysis (or post-optimality analysis) is used
to determine how the optimal solution is affected by
changes, within specified ranges, in:
• the objective function coefficients
• the right-hand side (RHS) values
• the constraint coefficients

 Sensitivity analysis is important to the manager who


must operate in a dynamic environment with imprecise
estimates of the coefficients.
 Sensitivity analysis allows her/him to ask certain what-if
questions about the problem.

Compiled by Nurhadi Siswanto 19

19

Reduced Cost
 The reduced cost for a decision variable whose value is 0
in the optimal solution is:
• the amount the variable's objective function coefficient
would have to improve (increase for maximization
problems, decrease for minimization problems) before
this variable could assume a positive value (e.g. come
into the solution).

 The reduced cost for a decision variable with a positive


value is 0.

Compiled by Nurhadi Siswanto 20

20

10
Range of Optimality
 The range of optimality of an objective function
coefficient is found by
• determining an interval for the objective function
coefficient in which the original solution (the decision
does not change and the value of the objective
function is still optimal, even if it changes) remains
optimal while keeping all other data of the problem
constant.

 The value of the objective function might change in this


range of optimality.

Compiled by Nurhadi Siswanto 21

21

Example: Olympic Bike Co.


 Range of Optimality

Question: Suppose the profit on deluxe frames is increased


to $20.

• Is the solution obtained above still optimal?

• What is the value of the objective function when this unit


profit is increased to $20?

Compiled by Nurhadi Siswanto 22

22

11
Example: Olympic Bike Co.
 Range of Optimality
Answer:
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between 7.5
and 22.5. Since 20 is within this range, the optimal solution
will not change. The optimal profit will change: 20x1 + 15x2
= 20(15) + 15(17.5) = $562.50.

OBJECTIVE FUNCTION RANGES


Variable Lower Limit Current Value Upper Limit
x1 7.500 10.000 22.500
x2 6.667 15.000 20.000

Compiled by Nurhadi Siswanto 23

23

Example: Olympic Bike Co.


 Range of Optimality
Question
If the unit profit on deluxe frames were $6 instead of
$10 would the optimal solution change?

Compiled by Nurhadi Siswanto 24

24

12
Example: Olympic Bike Co.

 Range of Optimality
Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between 7.5
and 22.5. Since 6 is outside this range, the optimal solution
would change.
OBJECTIVE FUNCTION RANGES
Variable Lower Limit Current Value Upper Limit
x1 7.500 10.000 22.500
x2 6.667 15.000 20.000

Compiled by Nurhadi Siswanto 25

25

Range of Optimality and 100% Rule


 The 100% rule states that:

 Simultaneous changes in objective function coefficients will


not change the optimal solution
as long as
the sum of the absolute values of the percentages of the
change
divided by the corresponding maximum allowable
change in the range of optimality for each coefficient
does not exceed 100%.

Compiled by Nurhadi Siswanto 26

26

13
Example: Olympic Bike Co.
 Range of Optimality and 100% Rule

Question:
If simultaneously
• 1) the profit on Deluxe frames was raised to $16 and
• 2) the profit on Professional frames was raised to $17,
would the current solution be optimal?

Compiled by Nurhadi Siswanto 27

27

Example: Olympic Bike Co.


 Range of Optimality and 100% Rule
Answer
• If c1 = 16, the amount c1 changed is 16 - 10 = 6 . The
maximum allowable increase is 22.5 - 10 = 12.5, so this is
a 6/12.5 = 48% change.
• If c2 = 17, the amount that c2 changed is 17 - 15 = 2. The
maximum allowable increase is 20 - 15 = 5 so this is a 2/5
= 40% change.

• The sum of the change percentages is 88%. Since this is


less than 100% the optimal solution would not change.

Compiled by Nurhadi Siswanto 28

28

14
Shadow Price
 A shadow price for a constraint’s right-hand side value is
the amount the objective function value will change per
unit increase in the right-hand side value of the
constraint.
 A shadow price reflects the value of an additional unit of
the resource if the resource cost is sunk.
 A shadow price reflects the extra value over the normal
cost of the resource when the resource cost is relevant.
 The shadow price for a non-binding constraint (one in
which there is positive slack or surplus when evaluated
at the optimal solution) is 0.

Compiled by Nurhadi Siswanto 29

29

Dual Price
 A dual price for a right-hand side (or resource limit) is the
amount the objective function will improve per unit
increase in the right-hand side value of a constraint.

 For maximization problems, dual prices and shadow prices


are the same.

 For minimization problems, shadow prices are the negative


of dual prices.

Compiled by Nurhadi Siswanto 30

30

15
Range of Feasibility

 The range of feasibility for a change in a right-hand side


value is:

• the range of values for this parameter in which the


original shadow price remains constant.

Compiled by Nurhadi Siswanto 31

31

Range of Feasibility and 100% Rule


 The 100% rule states that:

simultaneous changes in right-hand sides will not change


the shadow prices as long as the sum of the percentages of
the changes divided by the corresponding maximum
allowable change in the range of feasibility for each right-
hand side does not exceed 100%.

Compiled by Nurhadi Siswanto 32

32

16
Example: Olympic Bike Co.
 Range of Feasibility and Sunk Costs

Question

Given that aluminum is a sunk cost, what is the


maximum amount the company should pay for 50 extra
pounds of aluminum?

Compiled by Nurhadi Siswanto 33

33

Example: Olympic Bike Co.


 Range of Feasibility and Sunk Costs

Constraint Slack/Surplus Dual Price


1 0.000 3.125
2 0.000 1.250

RIGHTHAND SIDE RANGES


Constraint Lower Limit Current Value Upper Limit
1 53.333 100.000 160.000
2 50.000 80.000 150.000

Compiled by Nurhadi Siswanto 34

34

17
Example: Olympic Bike Co.
 Range of Feasibility and Sunk Costs

Answer
Since the cost for aluminum is a sunk cost, the shadow
price provides the value of extra aluminum.

The shadow price for aluminum is the same as its dual


price (for a maximization problem). The shadow price for
aluminum is $3.125 per pound and the maximum allowable
increase is 60 pounds. Since 50 is in this range, then the
$3.125 is valid. Thus, the value of 50 additional pounds is =
50($3.125) = $156.25.

Compiled by Nurhadi Siswanto 35

35

Example: Olympic Bike Co.


 Range of Feasibility and Relevant Costs

Question

If aluminum were a relevant cost, what is the


maximum amount the company should pay for 50 extra
pounds of aluminum?

Compiled by Nurhadi Siswanto 36

36

18
Example: Olympic Bike Co.
 Range of Feasibility and Relevant Costs

Answer

If aluminum were a relevant cost, the shadow price


would be the amount above the normal price of aluminum
the company would be willing to pay. Thus if initially
aluminum cost $4 per pound, then additional units in the
range of feasibility would be worth $4 + $3.125 = $7.125 per
pound.

Compiled by Nurhadi Siswanto 37

37

Solved by LINDO Software

Step 1

Click start button and select LINDO button

Compiled by Nurhadi Siswanto 38

38

19
Solved by LINDO Software

Step 2 Max 10x1 + 15x2 (Total Weekly Profit)


- Input the formulation
s.t. 2x1 + 4x2 < 100 (Aluminum Available)
3x1 + 2x2 < 80 (Steel Available)
x1, x2 > 0

Compiled by Nurhadi Siswanto 39

39

Solved by LINDO Software

Step 3
- Solve the formulation by clicking Solve Button

Compiled by Nurhadi Siswanto 40

40

20
Solved by LINDO Software

Step 4
- Interpret the result

Compiled by Nurhadi Siswanto 41

41

Solved by LINDO Software


 Optimal Solution
According to the output:
x1 (Deluxe frames) = 15,

x2 (Professional frames) = 17.5, and

Is it possible to have 17.5 bicycle?


Must be Integer
Compiled by Nurhadi Siswanto 42

42

21
Modifying to Integer Problem

- Define x1 and x2 as Integer variable

Compiled by Nurhadi Siswanto 43

43

Modifying to Integer Problem


- Interpret the result

Compiled by Nurhadi Siswanto 44

44

22
Modifying to Integer Problem
 Optimal Solution for Modifying Problem
According to the output:
x1 (Deluxe frames) = 14,
Make sense RESULT
Although it has
decreasing objective
function
Z=410
x2 (Professional frames) = 18, and

Compiled by Nurhadi Siswanto 45

45

Example 2
 Consider the following linear program:

Min 6x1 + 9x2 ($ cost)

s.t. x1 + 2x2 < 8


10x1 + 7.5x2 > 30
x2 > 2

x1, x2 > 0

Compiled by Nurhadi Siswanto 46

46

23
Example 2
 Computer Output:
OBJECTIVE FUNCTION VALUE = …….

Variable Value Reduced Cost


x1 ……. …….
x2 ……. …….

Constraint Slack/Surplus Dual Price


1 ……. …….
2 ……. …….
3 ……. …….

Compiled by Nurhadi Siswanto 47

47

Example 2
 Computer Output (Continued):
OBJECTIVE COEFFICIENT RANGES
Variable Lower Limit Current Value Upper Limit
x1 ……. ……. ……..
x2 ……. ……. No Upper Limit

RIGHTHAND SIDE RANGES


Constraint Lower Limit Current Value Upper Limit
1 ……. ……. No Upper Limit
2 ……… ……... ……..
3 ……. ……. ……
Compiled by Nurhadi Siswanto 48

48

24
Example 2
 Optimal Solution

According to the output:

• x1 = …….. and
• x2 = …….., and
• the objective function value = ………..

Compiled by Nurhadi Siswanto 49

49

Example 2
 Range of Optimality

Question

Suppose the unit cost of x1 is decreased to $4. Is the


current solution still optimal? What is the value of the
objective function when this unit cost is decreased to $4?

Compiled by Nurhadi Siswanto 50

50

25
Example 2
 Range of Optimality

Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between
…… and ……..

Since 4 is within this range, the optimal solution


(will/will not) change.

However, the optimal total cost will be affected: 4x1 +


9x2 = …………. + ……….. = $…………..

Compiled by Nurhadi Siswanto 51

51

Example 2
 Range of Optimality

Question
How much can the unit cost of x2 be decreased without
concern for the optimal solution changing?

Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x2 does not fall
below ………...

Compiled by Nurhadi Siswanto 52

52

26
Example 2
 Range of Optimality and 100% Rule

Question

If simultaneously the cost of x1 was raised to $7.5 and


the cost of x2 was reduced to $6, would the current solution
remain optimal?

Compiled by Nurhadi Siswanto 53

53

Example 2
 Range of Optimality and 100% Rule

Answer
If c1 = 7.5, the amount c1 changed is 7.5 - 6 = 1.5. The
maximum allowable increase is 12 - 6 = 6, so this is a
……../………= ………% change.
If c2 = 6, the amount that c2 changed is 9 - 6 = 3. The
maximum allowable decrease is 9 - 4.5 = 4.5, so this is a
……../…….. = ………% change.
The sum of the change percentages is ..…% + …..% =
……..%. Since this does not exceed 100% the optimal
solution (would/would not) change.

Compiled by Nurhadi Siswanto 54

54

27
Example 2
 Range of Feasibility

Question

If the right-hand side of constraint 3 is increased by 1,


what will be the effect on the optimal solution?

Compiled by Nurhadi Siswanto 55

55

Example 2
 Range of Feasibility

Answer
A dual price represents the improvement in the
objective function value per unit increase in the right-hand
side. A negative dual price indicates a deterioration
(negative improvement) in the objective, which in this
problem means an increase in total cost because we're
minimizing.
Since the right-hand side remains within the range of
feasibility, there is (change/no change) in the optimal
solution. However, the objective function value increases
by $4.50.
Compiled by Nurhadi Siswanto 56

56

28
The Effects of Degeneracy on
Range of Optimality analysis

 Degeneracy occurs when,


the Shadow Price = 0 for a Binding Constraint
 When Degeneracy is present, changes beyond the end-
points of the range of optimality do not necessarily mean
that a different solution will be optimal.
 Sensitivity analysis beyond the end-points of the range of
optimality necessitates re-solving the problem.

Compiled by Nurhadi Siswanto 57

57

Detecting the Presence of


Alternate Optimal Solutions

When you have a non-degenerate solution (The shadow


price is not equal to zero for all binding constraints)
And, you observe an allowable increase or decrease equal
to zero for one or more objective function coefficients,
Then, at least one alternative optimal solution exists!
Sadly, “Solver” won’t find it for you, however, other LP
software may!

Compiled by Nurhadi Siswanto 58

58

29
Transportation, Assignment, and Transshipment
Problems
 The Transportation Problem:
• The Network Model and a
• Linear Programming Formulation

 The Assignment Problem:


• The Network Model and a
• Linear Programming Formulation

 The Transshipment Problem:


• The Network Model and a
• Linear Programming Formulation
Compiled by Nurhadi Siswanto 59

59

Transportation, Assignment, and Transshipment


Problems: “Network Models”

A network model is one which can be represented by

 a set of nodes,

 a set of arcs, and

 functions (e.g. costs, supplies, demands, etc.) associated


with the arcs and/or nodes.

Compiled by Nurhadi Siswanto 60

60

30
More “Network Models”

 Transportation, assignment, and transshipment problems


of this chapter, as well as the

 shortest route, minimal spanning tree, and maximal flow


problems and

 PERT/CPM problems are all examples of network


problems.

Compiled by Nurhadi Siswanto 61

61

Transportation, Assignment,
and Transshipment Problems
 Each of these three models (transportation, assignment,
and transshipment models) can be formulated as linear
programs and solved by general purpose linear
programming codes.

 For each of the three models, if the right-hand side of the


linear programming formulations are all integers, the
optimal solution will be in terms of integer values for the
decision variables.

 However, there are many computer packages which


contain separate computer codes for these models which
take advantage of their network structure.
Compiled by Nurhadi Siswanto 62

62

31
Transportation Problem

The transportation problem seeks to minimize the total


shipping costs of transporting goods

 from m origins (each with a supply si)

 to n destinations (each with a demand dj),

 when the unit shipping cost from an origin, i, to a


destination, j, is cij.

Compiled by Nurhadi Siswanto 63

63

Transportation Problem
Supply Shipping Cost Demand
c11
s1 1 1 d1
c12
c21 c13

s2 2 2 d2
c31

s3 3 3 d3

Sources Destinations
(Origins) Commodity (Sinks)
factories cement warehouses
refineries oil distribution center
groves oranges stores.
. .
Compiled by Nurhadi Siswanto 64

64

32
Transportation Problem
 Problem Definition

1 D1=15
c11=6
S1=30 1 c12=2
c13=6
2 D2=18
c21=4
c22=9
S2=25 2
c23=5
3 D3=12

SOURCES DESTINATIONS

Compiled by Nurhadi Siswanto 65

65

Solved by POM Software

Step 1
-Choose Transportation
Module

-Click New for writing new Problem

Compiled by Nurhadi Siswanto 66

66

33
Solved by POM Software

Step 2
- Type the title of the problem, number of Sources and Destinations
- Choose type of objective function
- Choose format of the name options

Compiled by Nurhadi Siswanto 67

67

Solved by POM Software

Step 3
-Input data to the POM Software
-Choose starting method

Compiled by Nurhadi Siswanto 68

68

34
Solved by POM Software

Step 4
- Solve the formulation by clicking Solve Button

Compiled by Nurhadi Siswanto 69

69

Solved by POM Software

Step 5
- Interpret
the result

Compiled by Nurhadi Siswanto 70

70

35
Transportation Problem: Special Situations
 LP Formulation Special Cases or Situations.
Special-case modifications to the linear programming
formulation can be made, such as:
• Minimum shipping guarantees from i to j:
xij > Lij
• Maximum route capacity from i to j:
xij < Lij
• Unacceptable routes:
delete the variable

CAN POM SOLVE THE PROBLEM? NO


Compiled by Nurhadi Siswanto 71

71

Transportation Problem Formulation


 LP Formulation
The linear programming formulation in terms of the amounts
shipped from the origins to the destinations, xij, can be written as:

Min cijxij
ij

s.t. xij < si for each origin i


j

xij = dj for each destination j


i

xij > 0 for all i and j

Compiled by Nurhadi Siswanto 72

72

36
Transportation Problem Formulation
Objective Function
 Min cijxij
ij
Min 6x11+2x12 +6x13 +4x21+9x22 +5x23

Subject to
 xij < si for each origin i
j
x11+ x12 + x13 < 30
x21+ x22 + x23 < 25

Compiled by Nurhadi Siswanto 73

73

Transportation Problem Formulation

xij = dj for each destination j


i
x11+ x21 = 15
x12+ x22 = 18
x13+ x23 = 12

xij > 0 for all i and j

Compiled by Nurhadi Siswanto 74

74

37
Solved by LINDO

- Input the formulation and solve

Compiled by Nurhadi Siswanto 75

75

Solved by LINDO

- Interpret the result

Compiled by Nurhadi Siswanto 76

76

38
Adding Special Situations
 LP Formulation Special Cases or Situations.
Special-case modifications can be made, such as:
• Minimum shipping guarantees from i to j: xij > Lij
x22 > 5

• Maximum route capacity from i to j: xij < Lij


x12 < 10

Compiled by Nurhadi Siswanto 77

77

Adding Special Situations

- Add constraints to the formulation and solve it

Compiled by Nurhadi Siswanto 78

78

39
Adding Special Situations

- Interpret the result

Compiled by Nurhadi Siswanto 79

79

More Complex Transportation Problem

- Six sources and six destinations


c11
S1=30 1 1 D1=15
c12
c21 c13
S2=25 2 2 D2=18
c31

S3=10 3 3 D3=12
c44
S4=15 4 c45 4 D4=20
c54 c46

S5=28 5 5 D5=25
c64

S6=14 6 6 D6=22
Compiled by Nurhadi Siswanto 80

80

40
More Complex Transportation Problem

- Cost Data
Destination
Sources
1 2 3 4 5 6
1 6 2 6 7 4 2
2 4 9 5 3 8 5
3 5 2 1 9 7 4
4 7 6 7 3 9 2
5 2 3 9 5 7 2
6 5 5 2 2 8 1

HOWMANY VARIABLES AND CONSTRAINTS DO


THE PROBLEM HAVE?

Compiled by Nurhadi Siswanto 81

81

Why Use A Modeling Language - LINGO?


LINGO's modeling language can be expressed a problem in a natural
manner that is very similar to standard mathematical notation

Rather than entering each term of each constraint explicitly, we can


express a whole series of similar constraints in a single compact
statement
This leads to models that are much easier to maintain and
scale up

The data section allows you to isolate model's data from the formulation

Compiled by Nurhadi Siswanto 82

82

41
How to Model Using LINGO :
2 Warehouses and 3 Demands Transp. Problem
Objective Function
Min 6x11+2x12 +6x13 +4x21+9x22 +5x23

or in mathematical notation
Min cijxij
ij

The equivalent LINGO statement is:


MIN = @SUM( LINKS(I,J): C(I,J) * X(I,J));
Compiled by Nurhadi Siswanto 83

83

How to model Using LINGO :


2 sources and 3 Destination Transportation Problem
•Supply Constraints
x11+ x12 + x13 < 30
x21+ x22 + x23 < 25

Mathematical notation
xij < si for each origin i
j

The equivalent LINGO statement is:


@FOR( WAREHOUSES( I):
@SUM( VENDORS( J): X( I, J)) <= CAPACITY( I));
Compiled by Nurhadi Siswanto 84

84

42
How to model Using LINGO :
2 sources and 3 Destination Transportation Problem
•Demand Constraints
x11+ x21 = 15
x12+ x22 = 18
x13+ x23 = 12

Mathematical notation
xij = dj for each destination j
i

The equivalent LINGO statement is:


@FOR(VENDORS( J):
@SUM(WAREHOUSES( I): X( I, J)) = DEMAND( J));
Compiled by Nurhadi Siswanto 85

85

Solved by LINGO Software

Step 1

Click start button and select LINGO button

Compiled by Nurhadi Siswanto 86

86

43
Solved by LINGO Software

Step 2
Input data AND save to
the LINGO Software

Compiled by Nurhadi Siswanto 87

87

Solved by LINGO Software

Step 3
Solve the formulation
by clicking Solve Button
OR Ctrl-S

Compiled by Nurhadi Siswanto 88

88

44
Solved by LINGO Software

Step 4
- Interpret
the result

Compiled by Nurhadi Siswanto 89

89

How to Solve using LINGO : More Complex


Transportation Problem
- Six sources and Six destinations
c11
S1=30 1 1
c12 D1=15
c21 c13
S2=25 2
2 D2=18
c31
3
S3=10 3 D3=12
c44
S4=15 4 c45 4 D4=20
c54 c46

S5=28 5 5 D5=25
c64

S6=14 6 6 D6=22
Compiled by Nurhadi Siswanto 90

90

45
How to Solve using LINGO : More Complex
Transportation Problem
-The model does not change
-ONLY add the data

Compiled by Nurhadi Siswanto 91

91

How to Solve using LINGO : More Complex


Transportation Problem
-Solve by clicking CTRL-S
-Interpret the result

Compiled by Nurhadi Siswanto 92

92

46
Assignment Problem
 An assignment problem seeks to minimize the total cost
assignment of m workers to m jobs, given that the cost of
worker i performing job j is cij.
 It assumes all workers are assigned and each job is
performed.
 An assignment problem is a special case of a transportation
problem in which all supplies and all demands are equal to
1; hence assignment problems may be solved as linear
programs.
 The network representation of an assignment problem with
three workers and three jobs is shown on the next slide.

Compiled by Nurhadi Siswanto 93

93

Assignment Problem
 Problem Definition

C11=6
1 1
C12=2
C13=6

C21=4
C22=9
2 2
C23=5

C31=5
C32=2
3 C33=1 3

WORKERS JOBS
Compiled by Nurhadi Siswanto 94

94

47
Solved by POM Software

Step 1
-Choose Assignment
Module

-Click New for writing new Problem

Compiled by Nurhadi Siswanto 95

95

Solved by POM Software

Step 2
- Type the title of the problem, number of Jobs and Machines
- Choose type of objective function
- Choose format of the name options

Compiled by Nurhadi Siswanto 96

96

48
Solved by POM Software

Step 3
-Input data to the POM Software
-Solve the problem

Compiled by Nurhadi Siswanto 97

97

Solved by POM Software

Step 4
- Interpret
the result

Compiled by Nurhadi Siswanto 98

98

49
Assignment Problem
 Linear Programming Formulation

Min cijxij
ij

s.t. xij = 1 for each worker i


j

xij = 1 for each job j


i
xij = 0 or 1 for all i and j.

Compiled by Nurhadi Siswanto 99

99

Solved by LINDO

- Input the formulation and solve CTRL-S

Compiled by Nurhadi Siswanto 100

100

50
Solved by LINDO

- Interpret the result

Compiled by Nurhadi Siswanto 101

101

Solved by LINGO

-Input the formulation from


TRANSPORT Problem
-Only Change the DATA
(without changing the
variable names)

Compiled by Nurhadi Siswanto 102

102

51
Solved by LINGO

- Interpret the result

Compiled by Nurhadi Siswanto 103

103

Assignment Problem--Special
Considerations:
Special considerations can include:

 A modification to the right-hand side of the first constraint


set can be made if a worker is permitted to work more than 1
job.
 number of workers does not equal the number of jobs — add
dummy workers/jobs with 0 assignment costs as needed.
(note: this may not be necessary if a worker/job is allowed
more than one job/worker)
 worker i cannot do job j — assign cij = +M (where +M = some
very large number--implying a very large cost!).

Compiled by Nurhadi Siswanto 104

104

52
Assignment Problem
 Special Case - 1
1 C11=6 1
C12=2
C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C41=7
C42=6
4
C43=7
WORKERS JOBS
Compiled by Nurhadi Siswanto 105

105

Assignment Problem
 Special Case – 2 : Worker no.3 can do two jobs

1 C11=6 1
C12=2
C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C42=3
C41=7
C43=9 4

WORKERS JOBS
Compiled by Nurhadi Siswanto 106

106

53
Assignment Problem
 Special Case – 3 : Worker no.1 can not do job no. 2

1 C11=6 1

C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C42=3
C41=7
C43=9 4

WORKERS JOBS
Compiled by Nurhadi Siswanto 107

107

Transshipment Problem
 Transshipment problems are transportation problems in
which a shipment may move through intermediate nodes
(transshipment nodes)before reaching a particular
destination node.
 Transshipment problems can be converted to larger
transportation problems and solved by a special
transportation program.
 Transshipment problems can also be solved by general
purpose linear programming codes.
 The network representation for a transshipment problem
with two sources, three intermediate nodes, and two
destinations is shown on the next slide.
Compiled by Nurhadi Siswanto 108

108

54
Transshipment Problem
 Network Representation
3 c36
c13 c37
s1 1 c14 6 d1
c15 c46
4 c47
c23 c24
c56 7 d2
s2 2
c25
5 c57

SOURCES INTERMEDIATE DESTINATIONS


NODES
Compiled by Nurhadi Siswanto 109

109

Transshipment Problem
 Linear Programming Formulation
xij represents the shipment from node i to node j

Min cijxij
ij

s.t. xij < si for each origin i


j

xik - xkj = 0 for each intermediate


i j node k

xij = dj for each destination j


i
xij > 0 for all i and j

Compiled by Nurhadi Siswanto 110

110

55
Example: Transshipping
Thomas Industries and Washburn Corporation supply
three firms (Zrox, Hewes, Rockwright) with customized
shelving for its offices. They both order shelving from the
same two manufacturers, Arnold Manufacturers and
Supershelf, Inc.
Currently weekly demands by the users are 50 for Zrox,
60 for Hewes, and 40 for Rockwright. Both Arnold and
Supershelf can supply at most 75 units to its customers.
Additional data is shown on the next slide.

Compiled by Nurhadi Siswanto 111

111

Example: Transshipping
Because of long standing contracts based on past
orders, unit costs from the manufacturers to the suppliers
are:
Thomas Washburn
Arnold 5 8
Supershelf 7 4

The cost to install the shelving at the various locations


are:
Zrox Hewes Rockwright
Thomas 1 5 8
Washburn 3 4 4
Compiled by Nurhadi Siswanto 112

112

56
Example: Transshipping
 Network Representation
ZROX
Zrox 50

5 1
75 Arnold Thomas 5
8 8

ARNOLD Hewes 60

3 4
7
Super Wash-
75 Shelf
4 Burn 4
Rock-
Wright 40

Compiled by Nurhadi Siswanto 113

113

Example: Transshipping
 Linear Programming Formulation
• Decision Variables Defined
xij = amount shipped from manufacturer i to supplier j
xjk = amount shipped from supplier j to customer k
where i = 1 (Arnold), 2 (Supershelf)
j = 3 (Thomas), 4 (Washburn)
k = 5 (Zrox), 6 (Hewes), 7 (Rockwright)

 Note: A common mistake in Formulation is to define the


decision variable as Xijk -- implying that you have 2x2x3 =
12 decisions, when in fact, you only have
(2x2) + (2x3) = 10 decisions.
Compiled by Nurhadi Siswanto 114

114

57
Example: Transshipping
 Objective Function Defined

• Minimize Overall Shipping Costs:


Min 5x13 + 8x14 +
7x23 + 4x24 +
1x35 + 5x36 + 8x37 +
3x45 + 4x46 + 4x47

Compiled by Nurhadi Siswanto 115

115

Example: Transshipping
 Constraints Defined

Amount Out of Arnold: x13 + x14 < 75


Amount Out of Supershelf: x23 + x24 < 75
Amount Through Thomas: x13 + x23 - x35 - x36 - x37 = 0
Amount Through Washburn: x14 + x24 - x45 - x46 - x47 = 0
Amount Into Zrox: x35 + x45 = 50
Amount Into Hewes: x36 + x46 = 60
Amount Into Rockwright: x37 + x47 = 40

Non-negativity of Variables: xij > 0, for all i and j.

Compiled by Nurhadi Siswanto 116

116

58
Solved by LINDO

- Input the formulation and solve CTRL-S

Compiled by Nurhadi Siswanto 117

117

Solved by LINDO

- Interpret the result

Compiled by Nurhadi Siswanto 118

118

59
Solved by LINGO

-Input the formulation


to TRANSHIPMENT
Problem

Compiled by Nurhadi Siswanto 119

119

Solved by LINGO

-Interpret
the result

Compiled by Nurhadi Siswanto 120

120

60
Transshipping - Extension
 Network Representation
Zrox 50

75 Arnold 5 Thomas 1 5
8 8
ARNOLD Hewes 60
50
Super 7 Wash- 3 4
75
Shelf 4 Burn 4 Rock-
Wright 40
8 8
80 Super
6 Wash- 3 5
Blow By 6 Rock-
4 Blue 65

Compiled by Nurhadi Siswanto 121

121

61

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy