Handbook of Lecture and Response - or 2022
Handbook of Lecture and Response - or 2022
Handbook of Lecture and Response - or 2022
Operational Research
2022
FOREWORD
i
workforce needs, and conducting assessments. We also present forward-thinking and new
approaches to the future and the long term. Additional approaches include graph modeling and
analysis, process optimization, simulation, and test planning for acquisition of real -world
applications. The application of theory can only be successful when the needs and goals of end
users can be clearly understood and modeled in problems. Applying techniques broadly while
ignoring the current state can lead to mistrust of results, models that perform poorly when
implemented, and other failures. All problems and needs cannot be solved overnight or with
one model. This is where continuous improvement and systematic measures are needed. The
use of OR in practice should build models and analyzes that fit the problem space and end-user
goals. Next, in each chapter, we define a learning outcome (LO) that illustrates what important
points the learner should understand in the chapter and related sub-chapters. At the end of each
chapter, we provide material for evaluating the achievement of the LO. With this approach, we
hope to be able to deepen students' understanding of the methodology or algorithm as well as
the approaches presented in each section of this book. Ultimately able to provide perspective
in identifying the solution framework that has been developed, what trends and challenges
should be prepared, and an understanding of where the field is located.
The target audience for this handbook is undergraduate, postgraduate and practitioner students
to facilitate understanding of the use of OR techniques and methods in practice. Students from
engineering, management and other quantitative fields can benefit from a collection of case
studies and approaches in industrial, business operations or agricultural contexts. While
business practitioners, government, both civil and non-civilian assigned to as OR analysts and
systems analysis (ORSA)), will benefit from the discussion of this handbook on
methodological approaches, user and stakeholder relations, applications , and the real -world
perspective of the solutions obtained. Teachers, both lecturers and class instructors, will benefit
from this handbook through approaches and case studies that can be used directly in the
classroom or in response. Students benefit from access to hands-on and practical experience
from analysts and researchers in the field. Regardless of background, readers of this handbook
will find solutions to problems facing industry and business problem spaces every day. This
handbook discusses both emerging issues and new case trends in the field. As such, we apply
the latest technological developments to case studies and applications while identifying best
practices that are unique between analysis and trends in the field. We sincerely appreciate your
ii
interest in this handbook as a reader, student, researcher, practitioner, or instructor. We hope
you find the content in each section of this book valuable and important in understanding the
analysis you need to build the quantitative and engineering solutions you need. We welcome
your comments and input to support future editions of this handbook.
Thank-You Note
We would like to thank the Guidance Team for the undergraduate, masters and doctoral strata
of the Class of 2020 from the Agricultural Industrial Engineering study program and the
Computer Science study program at IPB University led by Achmad Mujib, Muslih Hakim and
friends for developing this book to completion. We also really appreciate the dedication of the
2022 revision team led by Dudin and friends. We would also like to thank all of us who have
contributed to the algorithms and coding used in this book as well as our fellow lecturers who
have provided constructive input to make this book a reality. Finally, we thank the family who
have always supported this project from ideas and inspiration to concrete results
.
Bogor, April 2022
iii
TABLE OF CONTENTS
FOREWORD i
TABLE OF CONTENTS iv
CHAPTER I DEFINITION AND BASIC CONCEPTS OF OPERATIONS RESEARCH 1
CHAPTER II LINEAR PROGRAM TECHNIQUES: MATHEMATICS
FORMULATION, GRAPHIC SOLUTIONS, AND EXCEL SOLVER 7
CHAPTER III LINEAR PROGRAM TECHNIQUES : SIMPLEX METHOD 16
CHAPTER IV LINEAR PROGRAM TECHNIQUES: DUALITY THEORY AND
SENSITIVITY ANALYSIS 25
CHAPTER V LINEAR PROGRAM TECHNIQUES: REVISED SIMPLEX METHOD
& INTERIOR POINT ALGORITHM 34
CHAPTER VI INTEGER PROGRAMMING 43
CHAPTER VII IMPLEMENTATION OF THE INTEGER PROGRAMMING WITH
SEVERAL VARIETIES OF CASE APPROACH 57
CHAPTER VIII GOAL PROGRAMMING MODEL AND SOLUTION METHODS 66
CHAPTER IX LINEAR PROGRAM TEHNIQUE: TRANSPORTATION AND
ASSIGNMENT MODELS 77
CHAPTER X LINEAR PROGRAM TECHNIQUES: NETWORK ANALYSIS FOR
TSP, MAXIMUM FLOW, MINIMUM FLOW AND MULTI-COMMODITY FLOW 89
CHAPTER XI LINEAR PROGRAM TECHNIQUES: CPM/PERT/PDM NETWORK
ANALYSIS 105
CHAPTER XII APPLICATION OF NETWORK ANALYSIS WITH SEVERAL
VARIETIES OF CASE APPROACH 123
CHAPTER XIII DYNAMIC PROGRAMMING 130
CHAPTER XIV GAME THEORY 152
BIBLIOGRAPHY 169
iv
v
CHAPTER I
DEFINITION AND BASIC CONCEPTS OF OPERATIONS RESEARCH
Learning Objectives of Chapter I are expected that students are able to:
1. Explain the definitions and basic concepts of operations research
2. Understand the characteristics of operations research
3. Understanding in general the stages of solving operations research problems
4. Explain and understand the role of operations research in various aspects, especially in agro-
industry
1
Decision variables (Decision variables)
The decision variable depends on the type of problem being considered. For example, the
decision variable can be the number of resources to be allocated, the number of units to be
produced, or both. The decision maker looks for the set of values of this unknown variable that
will give the optimal solution to the problem. Decision variables generally use the notation x1,
x2, . . . or x, y, and z. However, variable names can be defined as the model developer wishes.
Although some software products limit the variable length of the name, others allow the length
of alphabetic or alphanumeric characters. Sometimes, it is useful to define meaningful names
for variables. Generally, variable names used are short because (1) can reduce errors in writing
and typing; (2) the model looks more compact.
Constraints
Constraints or known as constraints, restrictions or problem constraints. Constraints consist
of two components, namely functions and constants followed by an equation or inequality sign.
In a resource constraint, the total resources required in terms of variables are represented by
functions and the availability of all resources is represented by constants. Data such as
resources required per unit of product are required to form the constraint function. These data
are known as coefficients related to constraints or technology coefficients. Note that most
optimization software products adhere to the convention of having variable expressions on the
left side (LHS) of the constraint equation and constants on the right side of the equation (right).
2
1.3 Operations Research Problem Solving Stages
An operations research problem can generally be solved using a standard flow.
Coherent and regular work can make the completion easier. Briefly, the research research
framework is shown in Figure.
Figure 1.1 Operations research problems within the framework (Radit 2015)
The choice of the problem which is a decision variable can be solved by an optimization
model or often called a mathematical program with the aim of determining the value of the
objective function (maximizing or minimizing) of the decision variable subject to constraints
on the value of the variable that states the limit of possible decision choices. (Radit 2015).
Working on a problem using operations research techniques can be divided into several stages,
namely:
1. Problem Formulation
The operations research analyst team needs to understand the situation and determine
what happens to a problem to be solved, then determine the variables and constraints. In
addition, it is needed to be able to identify the purpose of the problem to be solved. These
components need to be formed in a brief and concise statement or description. The description
should contain:
• A precise description of the purpose of the problem being studied.
• Identification of controlled and uncontrolled variables.
• Limitation of the problem
3
Example statement:
Company A produces products X and Y, using 5 machines, namely machine A, machine B,
machine C, machine D, and machine E. Machine A is used for 1 hour for product X, and 2
hours for product Y, machine B used for 3 hours for product X, and 1 hour for product Y,
machine C is used for 2 hours for product X, and 4 hours for product Y, machine D is used for
1 hour for product X, and 3 hours for product Y, lastly machine E is used for 3 hours for product
X, and 1 hour for product Y, in the next production planning, machine A can operate for 40
hours, machine B 50 hours, machine C300 hours, machine D 200 hours, and machine E 70
hours. If 1 product X provides a profit of 1000 rupiahs, and product Y 1500 rupiahs, how many
products X and Y that need to be produced to be able to generate maximum profit for the
company?
2. Variable Determination
Variable is the amount of an item or other that will be calculated on a problem. In the
above case, the variables are products X and Y produced by the company. Variables are written
in capital letters, and then written in lower case in the model.
4. Goal Setting
Goals are desires that are trying to be achieved on a problem. In this example, the goal
is to maximize the profits from producing products X and Y.
5. Determination of Relationships Between Variables and Modeling
Making a model of the problem in a mathematical clause, it takes the values that have
been determined in the statement. For example, product X takes 1 hour to work on machine A
and product Y takes 2 hours, but machine A only has a production capacity of 40 hours. Then
the clause that can be made is X + 2Y 40. While the purpose of the problem is to maximize the
company's profit with the production profit of product X is 1000 rupiah and Y is 1500. So the
equation is Maximize Z = 1000X+1500Y. where the production of products X and Y is not
negative, so it is necessary to add this information. If the above mathematical clause is rewritten
into a model, it will be obtained:
Maximize Z = 1000X+1500Y -> Fungsi tujuan
X + 2Y ≤ 40
3X + Y ≤ 50
2X + 4Y ≤ 300
X + 3Y ≤ 200
3X + Y ≤ 70
X dan Y ≥ 0
4
6. Identify Alternative Solutions
At this stage, the model will be completed using operations research techniques so that
it can produce an optimal solution.
5
6
CHAPTER II
LINEAR PROGRAM TECHNIQUES: MATHEMATICS FORMULATION,
GRAPHIC SOLUTIONS, AND EXCEL SOLVER
Learning Objectives of Chapter II are that students are expected to able to:
1. Understand and apply the process of mathematical formulation of linear programming
2. Analyze decision variables, objective functions, and constraints of a problem
3. Describe a graphical solution of modeling with a linear program
4. Use Excel software to solve linear programming problems
7
The purpose of linear programming is to find the optimum value, namely the
maximum or minimum of the objective function, taking into account the constraints
that arise as a result of the constraint function. The objective function and the constraint
function will include decision variables, where this decision variable is a mathematical
representation of the types of goods or units involved in the problem.
To explain the stage of formulating a mathematical model, let's look at the
following example questions:
“A wet bread dough is made using 2 kg of flour and 1 kg of sugar. While one
dry bread dough is made using 2 kg of flour and 3 kg of sugar. Mother has a supply of
30 kg of flour and 25 kg of sugar. If each one of the wet cake doughs can provide a
profit of Rp. 75,000.00 and each cookie dough can provide a profit of Rp. 60,000.00.
How many combinations of bread dough need to be made to get the maximum profit?”
• Before formulating into inequality functions, we need to first determine the decision
variables that represent each type of item. In the case above, there are two types,
namely wet bread dough and dry bread dough. Flour and sugar are not included in
the decision variables because the amount of these two types of goods does not
directly affect the profits. We determine:
x1 : number of wet bread dough production
x2 : number of dry bread dough production
• After determining the decision variables, we formulate the objective function of the
model. In the example above, looking for maximum profit by determining the
combination of the number of two doughs, namely wet bread dough and dry bread
dough. Wet bread provides a profit of IDR 75,000 per one dough, while a profit of
IDR 60,000 for one dry bread dough. We formulate:
Maximize F(x) = 75.000x1 + 60.000x2
• After determining the objective function, we formulate another statement to be a
constraint function. In linear programming, the constraint function generally arises
because of the limited amount of a resource. In the case above, the amount of flour
and sugar that the mother has is 20 kg of flour and 15 kg of sugar. For making one
wet dough and one dry dough each requires 2 kg of flour, but the use of flour is
limited to 30 kg, so that:
2x1 + 2x2 <= 30
In addition, it takes 1 kg of sugar for one wet dough making, and 3 kg of sugar for
one dry dough making - but the use of sugar is limited to 25 kg, so:
1x1 + 3x2 <= 25
• Thus, the linear programming model for this problem is:
Maximize F(x) = 75.000x1 + 60.000x2
Subject to:
2x1 + 2x2 <= 30
1x1 + 3x2 <= 25
x1 >= 0 , x2 >= 0
After formulating the mathematical model, the optimum value is found using a
graph.
8
2.3 Solving Linear Program-Based Modelling with Graph Formulation
Each predefined constraint function is painted into a Cartesian plane. Through graph
formulation, finding the optimum value will be easier because we can see the intersection point
of each constraint function. In the case of a linear program, if there are many constraint
functions, then there will be several intersection points, where we need to test the benefits
obtained at each of these intersections. The following is a graphical formulation of the
mathematical model that has been made above:
In this case, there is only one point that intersects, namely the line 2x 1 + 2x2 <=30 with
the line 1x1 + 3x2 <= 25. To find the coordinates of the intersection point, we can use
elimination
x2 = 5 and x1 = 10.
Hence, to achieve maximum profit, mothers need to make 10 wet bread doughs and 5
dry bread doughs, with a maximum profit of IDR 1,050,000. For other cases, if there is more
than one intersection point, it is necessary to determine the coordinates of each intersection
point and the number of advantages, then the point with the highest profit is chosen as the
optimal solution.
9
Figure 2.2 Solver add-in
10
Solution:
1. Identifying the main components in the formulation of the mathematical model of a linear
program consists of 3 components, including decision variables, objective functions, and
constraint functions. In determining the decision variables, you must first determine what
things or variables will be maximized, in the problem above there are three variables that
must be generated, namely tv, stereo and speakers.
Determine the notation of each variable, namely:
TV for tv products produced
ST for the resulting stereo product
SP for the resulting speaker product
The objective function is formed to show the linear relationship of the decision variables.
The purpose of the problem above is to maximize the total profit. Profit is the amount of
profit earned from each product.
Profit for TV products is the result of multiplying the number of TV products with profit
per unit (175,000), as well as in determining the profit for stereo products and speaker
products with the same calculation as TV products. If the total profit is denoted by Z then it
can be written: Z = 175 TV + 75ST + 50 SP
Constraint functions are all constraints or constraints on the problem, constraint functions
are shown in equations and or inequalities that indicate resource limitations.
Constraints of each component can be written as follows:
1TV + 1ST 42 => for chassis constraint
1TV 250 => for picture tube constraint
2TV + 2ST + 1SP 70 => for speaker cone constraint
1TV + 1ST 450 => for power supply constraints
2TV + 2ST + 1SP 650 => for electronic equipment problems
TV, ST, SP 0
2. Write a complete linear program formulation
Goal: Maximize Z = 175 TV + 75 ST + 50 SP
Constrains:
1TV + 1ST ≤ 425
1TV ≤ 250
2TV + 2ST + 1SP ≤ 700
1TV + 1ST ≤ 450
2TV + 2ST + 1SP ≤ 650
TV, ST, SP ≥ 0
3. Enter Excel Solver
11
• Column title and name are adjusted as desired, make sure the cell position is the same
as the example above,
• Enter the inventory value of each component in cells B6 to cell B10,
• Enter the coefficient value of the constraint function in the range D6:F10, for example
in the picture tube constraint function the value entered is 1 0 0, a value of 1 indicates
that the picture tube is only needed in TV production as much as 1 unit, while stereo
and speakers do not use picture tube components
• For cells C6 to C10 enter the formula =$D$4*D6+$E$4*E6+$F$4*F6, the following
formula is used to compare the component inventory values with those used
• In the range D12 to F12, enter the value for the objective function, for example in cell
D12 the formula entered is =175*D4, 175 is the profit value of 1 tv unit, then
sequentially for stereo and speakers.
• To add up all the profits from each product, in cell D13 enter the formula
=SUM(D12:F12).
• set target cell enter the result cell total profit i.e. $D$13
• equal to select (click) Max
• by changing cells, enter the result of the calculation of the number of products, namely
$D$4:$F$4
• select Add to fill the constraint function.
12
• cell reference, enter the cell range that is $C$6:$C$10
• in the middle select <=
• constraint, enter cell range =$B$6:$B$10
• add constraint states that the use of components should not exceed the available
resources
• select OK, then will display appear Solver Parameter like the picture in on, select
Options, the display will appear like the picture below:
• check Assume Linear Model, stating that the model used is a Linear Programming
model.
• check Assume Non-Negative, stating that the constraint function must not have a
negative product value (>= 0). The other options are ignored for now.
• select OK, the Solver Parameters display will reappear as before. After selecting Solve
will look at the following view, then select OK.
13
Figure 2.9 Final score
After selecting OK, the solver results will appear as shown above, in the image above it can
be seen:
• In the D4:F4 range, which shows the number of product units that will be made to
generate maximum profit, namely the number of TVs, Stereos and Speakers made are
250 TV units, 50 Stereo units and 100 Speaker units
• Cell range cell C6:C10 is the number of components used
• Cell range D12:F12 shows the profit earned from each product
• Cell D13 shows the maximum total profit earned
14
15
CHAPTER III
LINEAR PROGRAM TECHNIQUES: SIMPLEX METHOD
Learning objectives of Chapter III are that students are expected to able to:
1. Understand and explain the concept of the simplex method
2. Solve problems using the simplex method
BV X1 X2 S1 S2 S3 RHS
Z -C1 -C2 0 0 0 0
S1 A11 A12 1 0 0 B1
S2 A21 A22 0 1 0 B2
S3 A31 A32 0 0 1 B3
Table 3.1 Initial table of simplex method
16
For example: index Z = ~, S1 = 8, S2 = 6, S3 = 7, then KR is in row S2
BV X1 X2 S1 S2 S3 RHS INDEX*
Z -C1 -C2 0 0 0 0 ~
S1 A11 A12 1 0 0 B1 8
S2 A21 A22 0 1 0 B2 6
S3 A31 A32 0 0 1 B3 7
*example
Table 3.2 Key Row Determination
BV X1 X2 S1 S2 S3 RHS INDEX*
Z -C1 -C2 0 0 0 0 ~
S1 A11 A12 1 0 0 B1 8
S2 A21 A22 0 1 0 B2 6
S3 A31 A32 0 0 1 B3 2.5
Table 3.3 Determination of Key Element
BV X1 X2 S1 S2 S3 RHS
Z
S1
X1 k l m n o p
S3
Table 3.4 Determination of New Key Row
a. Row Z
-C1 -C2 0 0 0 0
-(A21) (k l m n o p)
… … … … … …
17
b. Row S1
A11 A12 1 0 0 B1
-(A21) (k l m n o p)
… … … … … …
c. Row S3
A31 A32 0 0 1 B3
-(A21) (k l m n o p)
… … … … … …
BV X1 X2 S1 S2 S3 RHS
Z
S1
X1 k l m n o p
S3
Table 3.5 New Key Row Table
9. Optimization test
Optimization test is carried out to find out whether the table has reached the optimum
point or not, provided that:
Maximization = value in row Z ≥ 0 (all positive)
Minimization = value in row Z ≤ 0 (all negative)
If it is not optimal, then do the repetition starting from step 3.
The steps for solving profit maximization using the simplex method are:
1. Z = 750X1 + 500X2 🡪 Z – 750X1 – 500X2 = 0
2. 2,5X1 + 2X2 + S1 = 100
X1 + 6X2 + S2 = 50
3X1 + S3 = 75
3. Initial simplex table
BV X1 X2 S1 S2 S3 RHS
Z -750 -500 0 0 0 0
S1 2,5 2 1 0 0 100
S2 1 6 0 1 0 50
S3 3 0 0 0 1 75
Table 3.6 Initial iteration
18
4. Key Column
BV X1 X2 S1 S2 S3 RHS
Z -750 -500 0 0 0 0
S1 2,5 2 1 0 0 100
S2 1 6 0 1 0 50
S3 3 0 0 0 1 75
Table 3.7 Determining Key Columns
5. Key Row
BV X1 X2 S1 S2 S3 RHS INDEX
Z -750 -500 0 0 0 0 0
S1 2,5 2 1 0 0 100 40
S2 1 6 0 1 0 50 50
S3 3 0 0 0 1 75 25
Table 3.8 Determining Key Row
BV X1 X2 S1 S2 S3 RHS INDEX
Z -750 -500 0 0 0 0 0
S1 2.5 2 1 0 0 100 40
S2 1 6 0 1 0 50 50
S3 3 0 0 0 1 75 25
Table 3.9 Determining Key Element
Hence, KE = 3
7. New Key Row
BV X1 X2 S1 S2 S3 RHS
S1
S2
X1 1 0 0 0 0,3333 25
19
8. Determining a value other than New Key Row
Where, New Row = Old Row – (Coefficient of KC) (Coefficient NKR)
a. Row Z
-750 -500 0 0 0 0
-(-750) (1 0 0 0 0.3333 25)
0 -500 0 0 250 18750
b. Row S1
2.5 2 1 0 0 100
-(2.5) (1 0 0 0 0.3333 25)
0 2 0 0 -0.833 37.5
c. Row S2
1 6 0 1 0 50
-(1) (1 0 0 0 0.3333 25)
0 6 0 1 -0.333 25
BV X1 X2 S1 S2 S3 RHS
Z 0 -500 0 0 250 18750
S1 0 2 0 0 -0.833 37.5
S2 0 6 0 1 -0.333 25
X1 1 0 0 0 0.3333 25
Table 3.11 Second iteration
9. Optimization test
The second iteration table shows that the Z value has not reached ≥ 0, then the third
iteration must be carried out.
BV X1 X2 S1 S2 S3 RHS INDEX
Z 0 -500 0 0 250 18750 -37.5
S1 0 2 0 0 -0.833 37.5 18.75
S2 0 6 0 1 -0.333 25 4.16667
X1 1 0 0 0 0.3333 25 -
Table 3.12 Second iteration
Hence, KE = 6
BV X1 X2 S1 S2 S3 RHS
Z
S1
X2 0 1 0 0.667 -0.0555 4.1667
X1 1 0 0 0 0.3333 25
Table 3.13 Define New Key Row
20
Specifying a value other than NKR:
a. Row Z
0 -500 0 0 250 18750
-(-500) (1 0 0 0 0.3333 25)
0 0 0 83,333 222.22 20833
b. Row S1
0 2 0 0 -0.833 37.5
-(2) (1 0 0 0 0.3333 25)
0 0 1 -0.333 -0.722 29,167
c. Row X1
1 0 0 0 0.3333 25
-(0) (1 0 0 0 0.3333 25)
1 0 0 0 0.3333 25
BV X1 X2 S1 S2 S3 RHS
Z 0 0 0 83,333 222.22 20833
S1 0 0 1 -0.333 -0.722 29,167
X2 0 1 0 0.667 -0.0555 4.1667
X1 1 0 0 0 0.3333 25
Table 3.14 Third iteration table
Interpretation:
The optimal combination is obtained if the company produces 25 units of adult’s
clothing and 4.1667 units of children’s clothing so that the maximum profit obtained is
Rp. 20,833,-.
BV X1 X2 S1 S2 S3 RHS
Z -750 -500 0 0 0 0
S1 2.5 2 1 0 0 100
S2 1 6 0 1 0 50
S3 3 0 0 0 1 75
Z 0 -500 0 0 250 18750
S1 0 2 0 0 -0.833 37.5
S2 0 6 0 1 -0.333 25
X1 1 0 0 0 0.3333 25
Z 0 0 0 83.333 222.22 20833
S1 0 0 1 -0.333 -0.722 29.167
X2 0 1 0 0.667 -0.0555 4.1667
X1 1 0 0 0 0.3333 25
Table 3.15 Summary of Simplex Iteration Table
21
3.3. Application of the Simplex Minimization Method
The objective function is as follows:
Zmin = 80X1 + 75X2
Constraint function:
2X1 + 1,5X2 ≤ 150 cloth
X1 + 6X2 ≤ 200 labor
The steps for solving the cost minimization using the simplex method are:
1. Goal maximization method
a. Apply objective function with the value of -1
(Zmin = 80X1 + 75X2) (-1) = -Z = -80X1 + -75X2
b. Objective function coefficient is positive
c. Key column is selected with the largest positive value
d. The optimal table condition is that the value of row Z ≤ 0
Solution:
-Z = -80X1 + -75X2 🡪 -Z + 80X1 + 75X2 = 0
2X1 + 1,5X2 ≤ 150 🡪 2X1 + 1,5X2 + S1 = 150
X1 + 6X2 ≤ 200 🡪 X1 + 6X2 + S2 = 200
X1 ≥ 0
X2 ≥ 0
e. The calculation results are as follows:
BV X1 X2 S1 S2 RHS
Z -80 -75 0 0 0
S1 2 1.5 1 0 150
S2 1 3 0 1 200
Z 0 -15 40 0 6000
X1 1 0.75 0.5 0 75
S2 0 2.55 -0.5 1 125
Z 0 0 36.667 6.667 6833.3
X1 1 0 0.667 -0.333 33.33
X2 0 1 -0.222 0.444 55.556
Table 3.16 Summary of Simplex Iteration
Proof:
Z = 80X1 + 75X2
Z = 80(33.33) + 75(55.556)
= 6833
22
Z 0 0 1 0 0 0 0
X1 1 0 0.667 -0.667 -0.333 0.333 33.33
X2 0 1 -0.22 0.222 0.444 -0.444 55.55
Z 0 0 -36.67 36.667 -6.667 6.667 -6833.3
X1 1 0 0.6667 -0.667 -0.333 0.333 33.33
X2 0 1 -0.222 0.222 0.444 -0.444 55.556
Table 3.17 Summary of Simplex Iteration
Proof:
-Z = -80X1 – 75X2
-Z = -80(33.33) – 75(55.556)
-Z = -6833
23
24
CHAPTER IV
LINEAR PROGRAM TECHNIQUES: DUALITY THEORY AND
SENSITIVITY ANALYSIS
Learning objectives of Chapter IV are that students are expected to able to:
1. Understand duality theory and sensitivity analysis
2. Understand the sensitivity of changes in the objective function
3. Change the formulation from primal to dual
4. Solve dual problems and use sensitivity analysis
In the conditions of the above changes (with the objective function and constraints
changing), if we do the re-calculation from the beginning, it will take a long time. Next, there
is also the possibility of miscalculation due to this recalculation. In conditions like this, the role
of sensitivity analysis becomes important to be used in order to quickly obtain new optimal
results as a result of the emergence of the various changes above.
25
Objective function : Maximize Z = 3X1 + 5X2
Subject to :
Machine A = 2X1 ≤8
Machine B = 3X2 ≤ 15
Machine C = 6X1 + 5X2 ≤ 30
X1,X2 ≥0
Keep in mind again that the two functions above we get from the table created based on this
case:
A 2 0 8
B 0 3 15
C 6 5 30
Then the Dual case from the Primal (Simplex) case simplification table above is as follows:
A B C
X1 2 0 6 3
X2 0 3 5 5
8 15 30
26
If we substitute the notations X1 and X2, as well as A, B, and C using the general notation in
the Dual problem, we get:
Y1 Y2 Y3
Constraint 1 2 0 6 3
Constraint 2 0 3 5 5
8 15 30
Accordingly, the method for obtaining the objective function and its Primal (Simplex)
constraint, is the same and will also be applied to obtain the Dual objective function and
constraint. Based on the previous statement, the objective function and its Dual constraints (the
'reverse' of the objective function and its Primal constraint) are as follows:
Purpose Function:
Minimize Y = 8Y1 + 15Y2 + 30Y3 note that it becomes
Minimization
With Constraint:
27
Furthermore, if the two Primal and Dual problems above are juxtaposed, it will look as follows:
Constraint: Constraint:
The next question is: what is the real use of the relationship between the Primal (simplex) and
the dual?
And the answer to the question above; that Duality has the benefit of checking the suitability,
correctness of the values obtained by the Primal (Simplex) method so that the results can be
used for decision making by management. This has been described at the beginning of t he
discussion in Chapter IV.
However, let's take a closer look at Simplex's optimal result from the previous example
problem.
X1 X2 X3 X4 X5 NK
Another value that is useful and has an important role in addition to the existing results is the
value that is in row Z in the base variables X3, X4 and X5 (0, 5/6, and 1/2). How do we translate
these three values?
In general, the three values have meaning as the rate of addition of the company's profit value,
if each capacity limit is increased to 1 unit of capacity (For example machine A, which changes
28
from an operating duration of 8 hours, to 9 hours, and for machine B from an operating duration
of 15 hours). hours to 16 hours). Based on this, it can be concluded thus:
1) The basic variable X3 has a value of 0 (zero) which means that if the limit of a (Machine A)
its capacity is increased by 1 hour (from an operating capacity of 8 hours to an operating
capacity of 9 hours), then the company experiences an increase in profit of 0 or remains at
value 27.5.
2) The basic variable X4 which has a value of 5/6 means that if limit 2 (machine B) its capacity
is increased by 1 hour (from 15 hours it increases to 16 hours), so that the company
experiences an increase in profits by 5/6 to 28.34 (27 ,5+5/6).
3) The basic variable X5 which has a value of 1/2 indicates that if limit 3 (machine C) its
capacity is increased by 1 hour (from the duration of operation for 30 hours to a total of 31
hours), so the company has increased profits by 1/2 to 28 (27 ,5+0,5).
Is that true?
To answer the questions above, please consider the following calculations:
Limitation 2
The capacity is increased by 1 hour, so the new equation:
3X2 ≤ 16, and when connected with the third constraint
6X1 + 5X2 ≤ 30
And if the limit of 2 is multiplied by the number 5, and the limit of 3 is multiplied by the
number 3, then the result is as follows:
3X2 ≤ 16 ( × 5)
6X1 + 5X2 ≤ 30 (× 3)
15X2 ≤ 80
18X1 + 15X2 ≤ 90
---------------------------- -
-18 X1 ≤ - 10
X1 = -10 / - 18
X1 = 5/9
and to obtain the value of X2, the following equation is
used:
3X2 ≤ 16
X2 ≤ 16/3.
and then the values of X1 and X2 are entered into the
following objective function to obtain the value of Z:
29
Z = 3X1 + 5X2
= 3(5/9) + 5(16/3)
= 28,34
Thus, a new profit value can be obtained, which is 28.34 – 27.5 = 0.84 or with § dengan ⅚.
This also proves that if the capacity of the 2nd machine (limit 2) is increased by 1 hour (from
15 hours to 16 hours), then the profit will also increase by 5/6.
Furthermore, the benefit of this sensitivity analysis is, of course, to reduce or avoid re-
calculations, because in fact there is no need to re-calculate from the beginning. Basically
there are several types of changes to linear programming parameters, including:
1. Coefficient function of objective
2. The technical coefficient of the constraint function
3. Capacity from source
4. The addition of the constraint, and
5. Addition of new variables.
Broadly speaking, as a result of the changes in the linear programming parameters, it can
be formulated into one of the three points below:
this:
1. That the results obtained are fixed. This means that neither the basic variables nor their
values will change, or
2. That the basic variables have changed, but their values have not changed, or
3. These changes do not result in changes to the optimal solution
X1 X2 X3 X4 X5 NK
Z 0 0 0 56 12 27.5
X3 0 0 1 59 -13 193
X2 0 1 0 13 0 5
X1 1 0 0 -518 16 56
Table 4.5 Optimal Simplex
30
Based on the table above, these values can be made a matrix as follows
[1 5/9 -1/3 0 1/3 0 0 -5/18 16]
For various purposes of the previous calculations, this matrix is used. Then, to be able to
make more use of the matrix, the sequence of steps taken is as follows:
Test Execution
[0 5 3] *[ 1 5/9 -1/3 0 1/3 0 0 -5/18 1/6] = [0 5/6 1/2]
Note that the resulting value is [0 5/6 1/2] This value is the value in row Z of the Primal
(Simplex) optimal table which is under the base variables X3, X4, X5. It has also been
previously reviewed, that these three are values that indicate the additional profit obtained as a
result of increasing the capacity of 1 unit. These results indicate if the values that have been
generated are correct. Then it can also be stated the truth of the benefits of these values, and
can be trusted.
a. Pembuktian pertama
• Step 1
Determines the right value (NK) in the Primal (Simplex) constraint function of each
existing constraint. Based on the previous case study, the intended values are 8, 15, and 30
respectively.
• Step 2
Multiply the specified value by the matrix above. Then the calculation is obtained as
follows:
[1 5/9 -1/3 0 1/3 0 0 -5/18 1/6] * [8 15 30] = [19/3 5 5/6]
Please pay attention to the calculation results above! Then compare it with the value in the NK
column of the Primal (Simplex) optimal table. From the results, it can be concluded that the
results of these calculations are identical to the values in the NK column of the Primal
(Simplex) optimal table. The value obtained from the simplex table proves that it is true and
can be trusted.
These results indicate that the 3x3 matrix obtained from the values derived from the optimal
Primal (Simplex) table can also be used to obtain the optimal value of the production that must
be carried out (X1 = 5/6 and X2 = 5). As a consequence, if there is a change in the right value
limit (for example, there is a change in the duration of operation of machine B for 1 hour, or
an increase from 15 hours to 16 hours, and the profit rate increases by 5/6, which is 28.34,),
then the results can be determined using the help of this matrix. In more detail, you can check
the calculation below:
Please pay attention to the following statement! If the capacity of the 2nd limit of the right
value or the machine increases to 16, then does the profit also automatically increase to 5/6 (or
increases from 27.5 to 28.34)? Is this statement true?
31
If the values of X1 and X2 above are entered into the Primal (simplex) objective function, they
will get the following benefits:
Z = 3X1 + 5X2
= 3(5/9) + 5(15/3)
= 28,34
This value proves that the profit rate increases by so that it becomes 28.34. The same thing
occurs when there is a change in the coefficient of the objective function. For example, for a
certain reason (eg changes in currency exchange rates), the profit per unit for products X1 and
X2 changes. Example: profits are no longer in numbers 3 and 5, but become values 4 and 6.
Thus, the level of profit obtained by the new company is as follows:
32
33
CHAPTER V
LINEAR PROGRAM TECHNIQUES: REVISED SIMPLEX METHOD & INTERIOR
POINT ALGORITHM
Learning objectives of Chapter V are that students are expected to able to:
1. Understand and explain the concept of the revised simplex method
2. Build a revised simplex algorithm
3. Apply the revised simplex method to solve the problem
4. Understand and explain the concept of the Karmarkar algorithm (interior point)
It is known that the basic vector is XB, the base is B, and the objective vector is CB. In
the iteration of the ordinary simplex method, it can be represented as follows:
34
(Remember that the remaining n-1 non-basic variables are zero.) To increase xj above the
zero level, use one of the current basic variables. The extent to which xj is determined by the
requirement that all (XB)i remain non negative — i.e,
If (B-1Pj)i > 0 for at least one I, non-negativity condition, (X B) > 0 for all i, sets a limit on
the maximum increase in the value of the incoming variable xj — that is,
Let (XB)k be the base variable corresponding to the minimum ratio. It then follows that Pk
must be the leaving vector, and the dependent variable (basic) must become nonbasic (at the
zero level) in the next iteration of the simplex.
5.2 Revised Simplex Algorithm
Step 0. Make a basic feasible solution, let B and CB be the basis and the coefficients of
the objective vector.
Step 1. Calculate the inverse B-1 of base B using the appropriate inversion method.
Step 2. For each nonbasic vector Pj, calculate
35
Interior paint has a daily demand that must not exceed the demand for exterior paint by
more than 1 ton. The interior paint has a maximum daily demand of 2 tons. The Reddy Mikks
company plans to develop a strategy to determine the optimal (best) mix of interior and exterior
paint so that a paint product can be obtained that maximizes total daily profit.
Thus, the form of the solution to the linear programming equation:
Maximize z = 5x1 + 4x2
subject to
6x1 + 4x2 < 24 (1)
x1 + 2x2 < 6 (2)
-x1 + x2 < 1 (3)
x2 < 2 (4)
x 1 , x2 > 0 (5)
While the solution in the form of revised simplex:
subject
x1 , x2 , x3 , x4 , x5 , x 6 > 0
Iteration 0
So,
Optimality calculation:
36
Feasibility calculation:
Therefore,
Iteration 1
So,
Optimality calculation:
P2 is entering vector.
37
Feasibility calculation:
Therefore,
P4 is leaving vector.
So
inverted to
So,
Optimality calculation:
38
So, it can be concluded that the optimal solution in this case is:
2. Determine the new coefficients of the constraint function and the objective function
39
4. Define projected gradient
6. Calculate x as the completion of the experiment for the next iteration (Steps 1)
Problems Example:
It is known that the linear programming model, which aims to maximize the objective function:
Max z = 40x1 + 30x2
Subject to: 2x1 + 3x2 ≤ 60
2x1 + x2 ≤ 40
X1, x1 ≥ 0
Solution: The first step of solving using the interior point algorithm is by adding a slack
variable so that the linear program form becomes:
40
41
42
CHAPTER VI
INTEGER PROGRAMMING
Learning objectives of Chapter VI are that students are expected to able to:
1. Understand the concept of integer programming
2. Apply the steps to the integer program
3. Synthesize the integer programming model from the existing casesg
4. Mastering software for integer program optimization
5. Solve TSP problems with Branch & Bound (BB) and cutting plane algorithms
The impropriety in this manufacturing model can be accepted if the variables of the
existing problems are uncertain. Variables become certain if there are certain equation
restrictions in integer problems. For example: the constraint X1 + X2 + … + Xn = 1, where Xj
= (0,1) for all j. In this model condition, the rounding method cannot be used and it is very
important to use a definite solution. If all the decision variables in a problem must be integers,
it is called a pure whole number programming problem.
Problem 1:
43
Problem 3:
Comparison of the solution results of the three problems based on the simplex method
without integer restrictions, the real optimum integer solution and rounding to the nearest
integer is:
X1 = 5,38 X1 = 5 X1 = 7
1 X2 = 2,31 X2 = 2 X2 = 0
Z = 746,15 Z = 680 Z = 700
X1 = 1,82 X1 = 2 X1 = 3, X2 = 3
2 X2 = 3,27 X2 = 3 X1 = 5, X2 = 2
Z = 1.672,73 Z = Tak Layak Z = 1.800
X1 = 2,14 X1 = 2 X1 = 0
3 X2 = 1,71 X2 = 3 X2 = 3
Z = 343 Z = Tak Layak Z = 300
Table 6.1 Comparison of 3 problems
The first problem is maximization. The rounded solution yields a profit of 680. This
value is 20 less than the result of the optimum rounded solution of 700. The second problem is
minimization. The resulting rounded solution is an unfeasible solution. This shows that a
simplistic approach can lead to an infeasible solution. Steps to prevent this improper solution
by means of the problem of minimizing the value of the simplex solution are rounded up. An
example is the second problem. If the solution is rounded up, then X = 2 and X = 4 make the
solution feasible. On the other hand, if the problem is to maximize the value of the simplex
solution to the first and second problems, it should be rounded down.
The third problem is an improper rounding solution. The result of the solution can be
feasible if rounded down according to the minimization problem so that the simplex solution
X = 2.14 becomes 2 and X = 1.71 becomes 1. This result can be proven by examining 2 existing
model constraints with rounded decision variables. down.
The result of the objective value using the simplex method without integer restrictions
will obtain a better value than the optimum integer solution because its position is located at
the outer corner point of the feasible solution boundary. Another method that is similar to the
rounding approach is the trial and error model. The trick is, the decision maker observes the
integer solution and determines the solution that can optimize the value of the objective
function. The use of this method is not effective if it involves many constraints and variables,
because it takes a lot of time to examine each rounded solution.
44
Three models that can be used to solve integer programming problems are Pure Integer
Programming, Mixed Integer Programming, and Binary Integer Programming.
The shop owner plans to buy a printing press and a lathe. The owner has an estimate
that each printer can increase profits by $100/day and the lathe by $150/day. The area of the
place and the purchase price are in accordance with the following table:
Machine Surface Area (ft) Purchase price ($)
Printing 15 8000
press
Lathe 30 4000
Table 6.2 Examples of pure integer programming problems
The budget for the purchase of the machine is $40,000. The owner has a problem that
the available space is only 200 square feet. How many machines can the owner buy in order to
get maximum profit with a note that the solution cannot be in fractions?
The problem formulation for this case study is:
Maximize Z= 100 X1 + 150 X2
Subject to 15 X1 + 30X2 ≤ 200
8000 X1 + 4000X2 ≤ 40000
X1, X2 ≥ 0 dan integer
45
b. Mixed Integer Programming
Integer programming problem model, where some decision variables are constrained to
integers and some are not.
46
c. Binary Integer Programming
Integer programming problem model where the value of the decision variable is only
one and zero
BAPPEDA a city has a plan to build recreational facilities, namely swimming pools,
tennis courts, athletic fields and sports arenas. Estimated users, required costs and required land
area are:
Recreational Number of Users Cost ($) Land area (are)
Facilities (person/day)
Swimming Pool 300 35.000 4
Tennis Court 90 10.000 2
Athletic field 40 25.000 7
Sport Centre 150 90.000 3
Table 6.4 Examples of binary integer programming problems
BAPPEDA has an allocated land area of 12 acres and an available budget of $120,000.
One of the tennis courts or swimming pools will only be built because they are on the same
land. Which facilities need to be built by Bappeda so that users can reach the maximum ?
47
6.3.2 Solution Method
a. Round Off Method
This method is a method of rounding variable values using the ordinary simplex method. This
method is effective in getting a solution related to cost, time and effort. For example, the
number of clothes that must be produced is 656.75, then by using this method the decision is
obtained to be 567 pieces of clothing.
The use of this method is inappropriate or inappropriate in some rounding method problems.
This result has enormous consequences if the product to be rounded has a high selling price,
such as a cruise ship or airplane.
Solving this problem using the simplex method obtained solutions x 1 = 3, x2 = 3.333 and Z =
35.333. Solving the problem using the round off method will get the results x 1 = 3, x2 = 3 and
Z = 35.
The true integer solutions are x 1 = 0, x2 = 5, and Z = 35. The actual optimal value appears to
be larger than the rounding approximation.
The optimal solution method for a linear program that produces a number decision variable in
the form of an integer.
48
The solution obtained by using the simplex method is X1 = 2.25. X2 = 3.75 and Z = 41.25
The selected variable that is branched is the one that has the largest variable (X 2), so that a
new limiter is obtained, X2 ≤ 3 and X2 ≥ 4.
49
6.4 Software for Integer Programming Optimization
50
model, all you need to do is add the appropriate adjective (INTEGER or BINARY) in front of
the VARIABLES label to specify that the set of variables listed under the label is of that type.
Or you can ignore this specification in the variables section and instead place an integer or
binary constraint in the model section anywhere after the other constraints. In this case, the
label above the variable set becomes only INTEGER or BINARY
The MPL student version includes four elite solvers for linear programming CPLEX,
GUROBI. CoinMP, and SULUM and all four also include advanced algorithms for resolving
pure or mixed IP or BIP models. When using CPLEX, for example, by selecting the MIP
Strategy tab of the CPLEX Parameters dialog box in the Wing Options menu, experienced
practitioners can even choose from a wide variety of options for actual examples of how to
execute the algorithm to suit a particular problem.
Instructions on how to use these various software packages become clearer when you
see them applied to the examples. The Excel, LINGO/LINDO, and MPL/Solver files for this
chapter in OR Courseware show how each of these software options will be applied to the
prototype examples introduced in this section, as well as the following IP examples. The last
part of this chapter will focus on IP algorithms similar to those used in this software package.
Example for Mixed Linear Programming (MS. Excel)
51
Figure 6.1 Input data
52
6.5 TSP Solution with Algorithm
a. Branch and Bound Algorithm (B&B)
The idea of the b&b algorithm is to start with the optimal solution of the related
assignment problem. If the solution is a tour then the process ends. Otherwise, restrictions
are imposed on the resulting solution to disallow subtours. The idea is to create a branch
that assigns a zero value to each variable of one of the subtours. Usually, the subtour with
the smallest number of cities is selected for branching because this creates the smallest
number of branches.
If the solution to the assignment problem at any node is a tour, the objective value
provides an upper bound on the optimal tour length. Otherwise, further branching on the
node is required. A subproblem is obtained if it results in a smaller upper bound, or if it is
proven that it cannot lead to a better upper bound. The optimal tour is assigned to the node
with the smallest upper bound.
The following example provides details of solving a TSP with the B&B algorithm, look
the following 5 city TSP distance matrix
This task is solved using Ampl, Torra, or Excel. The solution is:
consists of two sub-hours, 1-3-1 and 2-5-4-2, and is the starting node of the b&b search
tree, as shown in node 1 in the figure below. In this example, we'll use a random tour, 1-
2-3-4-5-1, to determine the initial upper bound — which is 10 + 5 + 7 + 4 + 3 = 29 units.
The estimated upper bound means that the optimal tour length should not exceed 29. The
B&B node to be worked on looks for the smaller upper bound, if any.
53
At node 1 of the b&b tree, the smaller subgroups 1-3-1 create branches x13 = 0 to node
2 and x31 = 0 to node 3. The related assignment problems at nodes 2 and 3 are created from
problems at node 1 by assigning d13 = ∞ and d31 = ∞. At this point, we can examine node
2 or node 3, and freely choose to explore node 2. The fixing solutions are 2-5-2 and 1-4-
3-1 with z = 17. The solution is not a tour, choose a sub -smaller tour 2-5-2 for branching,
branch x25 = 0 leading to node 4 and branch x52 = 0 leading to node 5.
We have three unexplored subproblems: nodes 3, 4, and 5. Independently examine the
subproblem at node 4, assigning d 25 = in the distance matrix at node 2. The resulting
solution, tours 1-4-5-2-3 -1, resulting in a smaller upper bound z = 21.
Two sub-problems on nodes 3 and 5 remain to be explored. Selecting subproblem 5
independently, we assign d52 = to the distance matrix at node 2. The result is a tour of 1-4-
2-5-3-1 with a smaller upper bound z = 19. Subproblem 3 is the only one remaining
unexplored. Substituting d31 = in the distance matrix at node 1, we get a better tour solution:
1-3-4-2-5-1 with a smaller upper bound z = 16.
All nodes in the tree have been checked, thus completing the b&b search. The optimal
tour is the tour associated with the smallest upper limit: 1-3-4-2-5-1 with a length of 16
units
b. Cutting-Plane algorithm
Adding this cutting to the model results in a mixed integer linear programming (milp) with
binary xij and continuous uj.
The complete milp consists of the assignment model and additional constraints
in the table below. All xij = (0, 1) and all uj 0.
the optimum solution is u u2 = 0, u3 = 2, u4 = 3, x12 = x23 = x34 = x41 = 1. The appropriate
tour is 1-2-3-4-1 of length 59. The solution satisfies all additional constraints
54
Table 6.6 Cuts for removing subtours in the assignment model example
To show that a given optimal solution cannot satisfy the subtour solution,
consider subtour (1-2-1, 3-4-3), or x12 = x21 = 1, x34 = x43 = 1. Optimum value u2 = 0, u3 =
2, dan u4 = 3 and x43 = 1 do not meet the limits of 6,4 x43 + u4 - u3 ≤ 3, in the table above.
The drawback of the cutting-plane model is that the size of the resulting milp grows
exponentially with the number of cities, making the model computationally unworkable.
55
56
CHAPTER VII
IMPLEMENTATION OF THE INTEGER PROGRAMMING WITH SEVERAL
VARIETIES OF CASE APPROACH
Learning objectives for Chapter VII are students are expected to be able to:
1. Synthesize the Program Integer formulation for the Pure Integer case application
2. Synthesize the Program Integer formulation for the Mixed Integer/either-or case application
Troubleshooting requires installing at least one phone on each of the 11 roads (A to K).
So, the model becomes:
Min z = x1+x2+x3+x4+x5+x6+x7+x8
Constraints:
x1 + x 2 ≥1
x3 + x4 ≥1
57
x5 + x6 ≥1
x7 + x 8 ≥1
x2 + x6 ≥1
x1 + x6 ≥1
x4 + x7 ≥1
x2 + x4 ≥1
x5 + x8 ≥1
x3 + x5 ≥1
58
Figure 7.3 Solution with Lingo
59
Figure 7.4 Python Code
● Fixed Cost Problem
The problem of fixed costs relates to situations in which economic activity incurs two
types of costs, namely the fixed costs required to start the activity and the variable costs
which are proportional to the level of activity. For example, a machine before starting a
production incurs a fixed setup cost regardless of how many units are produced. Once setup
is complete, labor and material costs are proportional to the quantities produced. If F is fixed
cost, c is variable cost and x is production level, then the cost function can be written as
follows:
Cx = F + cx, if x>0 0, vice versa
The function C(x) cannot be practiced analytically because it involves a discontinuity
at x = 0. The example below shows how additional binary variables are used to make the
model workable analytically.
60
Defined:
x1= MaBell minutes per month
x2= PaBell minutes per month
x3= BabyBel minutes per month
y1= 1 if x1> 0 and 0 if x1= 0
y2= 1 if x2> 0 and 0 if x2= 0
y3= 1 if x3> 0 and 0 if x3= 0
We can confirm that yj equal to 1 if xj positive by using limits
xj ≤ M yj , j= 1,2,3.
The value of M must be chosen large enough so as not to artificially limit the x j variable.
Because I call about 200 minutes a month, then x j 200 for all j, then it is safe to choose
M = 200.
So the complete model is:
Min z = 0.25x1+ 0.21x2+ 0.22x3+ 16y1+25y2+18y3
Constraint function:
The formulation shows that the j th month fixed cost will be part of the objective
function z only if yj= 1, which can only happen if xj> 0 (corresponding to the last three
constraints of the model). If x j= 0 at its optimum, hence the minimization of z, together
with the fact that the objective coefficient of y j is positive, forcing yj equals zero, as desired.
The optimal solution yields x3= 200, y3= 1, and all remaining variables are equal to
zero, indicating that BabyBell should be selected as my remote carrier. Information
submitted by y3= 1 is redundant because the same result is implied by x3 > 0 (= 200). In
fact, the main reason for using y1, y2, and y3 is to take into account the fixed monthly costs.
As a result, the three binary variables turn the nonlinear model into an analytical
formulation that can be more easily worked out. This conversion has resulted in an integer
(binary) variable in a continuous problem.
● Capital Budgeting
The decision about whether or not to implement a project is usually made with
consideration of a limited budget and predetermined priorities. The following example relates
to one of these situations.
61
Five projects are being evaluated during the 3-year planning period. The following table
provides the expected results for each project and the associated annual expenditures:
The optimum integer solution (obtained via AMPL, Solver, or TORA) is x 1= x2= x3= x4= 1,
x5= 0, where z = 95 ($ million).
62
The purpose of this problem is to determine the sequence of jobs with the least
late penalty fees for processing the three jobs.
Is known that:
xj= Start date (in days) for job j (measured from time zero)
yij={1, if i precedes j 0, if j precedes i
This issue has two types of constraints/constraints: non-interference constraints
(guarantees that no two jobs are processed simultaneously) and due date constraints.
Consider non-interference constraints first.
Two jobs i and j with processing time pi and pj will not be processed concurrently
if (depending on which job is processed first).
xj+zj or xj xi+pi
The or constraint above can be converted into an and constraint by adding an additional
variable with a large enough value, namely M.
The conversion ensures that only one of the two restrictions can be active at a time. if
yij= 0, the first constraint is active, and the second constraint is redundant (because the
left side will include M, which is much larger than pi), and vice versa.
Furthermore, remembering djis the due date for job j, job will be late if x j+ pj> dj. We
can use two non-negative variables, sj- and sj+, to determine the status of work
completed j with respect to the due date — that is, the due date constraint can be written
as
Job j is ahead of schedule if sj- > 0, and the late penalty fee is proportional to sj+.
So the model for the above problem is:
z =19s1++ 12s2++ 34s3+
Constraint function:
63
To complete the model, set a value of M = 100, a value which is greater than the sum
of processing time for the three activities. The optimal solution is x1 = 20, x2, = 0, and
x3 = 25, meaning that job 2 starts at time 0, job 1 starts at time 20, and job 3 starts at
time 25, resulting in an optimal processing sequence 2 1 3. The solution is to complete
work 2 at time 0 + 20 = 20, work 1 at time = 20 + 5 = 25, and work 3 at 25 + 15 = 40
days. Job 3 is delayed for 40 - 35 = 5 days after the due date at a cost of 5 x $34 = $170.
64
65
CHAPTER VIII
GOAL PROGRAMMING MODEL AND SOLUTION METHODS
Learning Objectives of Chapter VIII are expected that students are able to:
1. Understand the goal programming model through formulation
2. Modeling goal linear programming through mathematical formulation
3. Understanding goal programming solving through the Weights Method
4. Understanding goal programming solution through Preemptive Method
Suppose that the variables xp, xf, and xs represent the tax rates (expressed as the basic
proportion of taxation) for property, food and medicine, and general sales and define the
variable xg as the gasoline tax in dollars per gallon. The city council's objectives were then
stated as:
66
Each model inequality represents a goal the city council wants to meet. In all likelihood,
the best that can be done is a compromise solution involving these conflicting goals. The GP's
way of finding a compromise solution is to turn any inequalities into flexible goals where the
associated constraints can be violated, if necessary. In the case of the Sabang city model, the
flexible objectives are stated as follows:
550 xp + 35 xf + 55 xs + 0.075 xg + s1- - s1+ = 16
55 xp – 31.5 xf + 5.5 xs + 0.0075 xg + s2- - s2+ = 0
110 xp + 7 xf – 44 xs + 0.015 xg + s3- - s3+ = 0
xg + s4- - s4+ = 2
xp, xf , xs, xg ≥ 0
si- , si+ ≥ 0, i = 1,2,3,4
The non-negative variables si- and si+, i = 1, 2,3,4, are deviational variables that
represent deviations below and above the right hand side of the constraint i. The deviational
variables si-and si+ are by definition dependent, and therefore cannot be base variables at the
same time (according to the simplex method theory). This means that in each simple iteration,
at most one of the two deviation variables can assume a positive value. In essence, the definition
of si-and si+ allows meeting or violating purposes at will. This is the kind of flexibility that
characterizes GP when it comes to compromise solutions. Logically, a good compromise
solution seeks to minimize the number of violations of each objective.
In the Sabang model, given that the first three constraints are of type and the fourth
constraint is of type the deviational variables s1-, s2-, s3-, and s4+ represent the number by
which the respective objectives are violated. Thus, the compromise solution seeks to fulfill the
following four objectives as much as possible:
Minimize G1 = s1-
Minimize G2 = s2-
Minimize G3 = s3-
Minimize G4 = s4+
These functions are minimized according to the model constraint equation.
How can we optimize a multi-object model with conflicting goals? Two methods have
been developed for this purpose: (1) the weighting method and (2) the preemptive method.
Both methods are based on converting multiple objectives into a single function.
67
3. Minimize for k = 1, 2, .., K
The goals are ordered and the deviation variables at each priority level are distinguished
using different weights.
In addition to the objective function, there are six different types of objective
constraints. Each type of constraint is determined by its relationship function with the
objective function
.
Table 8.1 Types of goal constraints
Weight Method
Suppose the GP model has n destinations and that the i-th destination is given as follows:
Minimize Gi, i = 1, 2, …. , n
The combined objective function used in the weighting method is then defined as:
Minimize z = w1G1 + w2G2 + … + wnGn
The parameters wi, i = 1, 2, … , n, are positive weights that reflect the decision maker's
preferences regarding the relative importance of each goal. For example, wi = 1, for all i,
signifies that all objectives are equally important. Determination of the specific value of this
weight is subjective. The following is an example of solving GP via the weight method:
Event space is a newly established advertising agency with 10 employees, has received a
contract to promote a new product. Agents can advertise via radio and television. The
following table shows the number of people reached each day by each ad type and the costs
and labor requirements
68
Radio Television
Reach (in million people)/minute 4 8
The contract prohibits the Event Room from using more than 6 minutes of radio advertising.
In addition, radio and television advertising must reach at least 45 million people. The Event
Room has a budget goal of $100,000 for the project. If x1 and x2 are minutes allocated to
radio and television advertising, then the GP formulation for the problem is:
Minimize G1 = s1- (broadcast coverage goal)
Minimize G2 = s2+ (budget goal)
Constraint
4x1 + 8x2 + s1- - s1+ = 45 (broadcast coverage destination)
8x1 + 24x2 + s2- - s2+ = 100 (budget goals)
x1 + 2x2 ≤ 10 (Worker limitation)
x1 ≤ 6 (Radio restrictions)
x1, x2, s1-, s1+, s2-, s2+ ≥ 0
Event Space Management estimates that broadcasting outreach goals are twice as important
as budget goals. The combined objective function becomes:
The optimum solutions are z = 10, x1 = 5 minutes, x2 = 2.5 minutes, s1- = 5 million
people, s1- = 0 and s2+ = 0. The fact that the optimal value of z is not zero indicates that at
least one of the objectives is not being met. Specifically, s1- = 5 means that the exposure
objective (at least 45 million people) not achieved (less than 5 million people). On the other
hand, the budget goal (not exceeding $100,000) is not violated, because s2+ = 0.
Although the GP is presented in the context of an optimized linear program, the end
result looks for a satisfactory solution rather than an optimal solution. This conclusion can be
proven by the example problem above where the "optimal" value in GP modelling is x1 = 5
minutes and x2 = 2.5 minutes with a broadcast coverage of 40 million people and a cost of
$100,000. On the other hand, if x1= 6 minutes and x2= 2 minutes, then the broadcast
coverage is still 40 million people (4x6 + 8x2) but costs $96,000 (8x6 + 24x2). In essence,
what GP does is find a “satisfactory” solution rather than an “optimal” solution.
69
Preemptive Method
In the preemptive method, the decision maker ranks the goals of the problem in order
of importance. If there are n-goals, the objective of the problem is
written as:
Minimize G1 = p1 (highest priority)
.
.
Minimize Gn = pn (least priority)
The variable p1 is the component of the deviation variable, si- or si+, representing the
objective i. For example, in the previous example p1 = s1- and p2 = s2+. The solution
procedure starts by optimizing the highest priority, G1, and ends by optimizing the lowest,
Gn. The preemptive method is designed in such a way that the lower priority solution never
lowers the higher priority solution.
The proposed column dropping modification need not complicate the GP. The
following shows that the same result can be achieved in a more direct way using the
following steps:
• Step 0. Identify goals and rank the models in order of priority:
G1 = p1 > G2 = p2 > …. > Gn = pn
Set i = 1
General Steps. Solve for LPi that minimizes Gi, and let pi = pi* determine the appropriate
optimal value of the deviation variable pi. If i = n, stop; The LPn completes the n-goal
program. Otherwise, add the pi = pi* constraint to the Gi problem constraint to ensure that
the pi value is not degraded in the next issue. Set i = i + 1, and repeat step i.
The following is an example of using the preemptive method. It is assumed that the
broadcast range has a higher priority.
• Step 0. G1 > G2
G1: Minimize s1- (broadcast coverage goal)
G2: Minimize = s2+ (budget goal)
• Step 1. Complete LP1
Minimize G1 = s1-
Obstacles
4x1 + 8x2 + s1- - s1+ = 45 (broadcast coverage purpose)
8x1 + 24x2 + s2- - s2+ = 100 (budget goal)
x1 + 2x2 < 10 (Worker limit)
x1 < 6 (Radio limitation)
x1, x2, s1-, s1+, s2-, s2+ >0
70
The optimal solution (defined by TORA) is x1 = 5 minutes, x2 = 2.5 minutes, s1- = 5 million
people, with the remaining variables equal to zero. The solution shows that the broadcast
coverage goal, G1 is being violated by 5 million people. An additional constraint to be added
to problem G2 is s1- = 5 (or, equivalently, s1- 5).
The new formulation is one variable less than the one in LP1, which is the general idea
put forward by the column dropping-rule. Actually, LP2 optimization is not needed in this
problem, because the optimal solution for problem G1 already produces s2+ = 0. That is, it is
already optimal for LP2. Such computational saving opportunities should be exploited during
the application of the preemptive method. Using the same problem as before, here is an
example of a solution using the column dropping-rule.
Priority 1: maximize broadcast coverage (p1)
Priority 2: minimize costs (p2)
Mathematically, the objective function becomes:
Maximize p1 = 4x1 + 8x2 (broadcast range)
Minimize p2 = 8x1 + 24x2 (cost)
The specific objective constraints on the objective functions (45 and 100) are omitted because
we will use the simplex method to determine these limits optimally.
• Step 2. Add a constraint of 4x1 + 8x2 40 to ensure that target G1 is not degraded. So, we
solve for LP2 as
Minimize p2 = 8x1 + 24x2
71
Obstacles:
x1 + 2x2 < 10
x1 <6
4x1 + 8x2 > 40 (additional)
x1, x2 >0
The optimal solution for LP2 is P2 = $96,000, x1 = 6 min, and x2 = 2 min. With the
same amount of broadcast reach (p1 = 40 million people) but at a lower cost than the previous
one ($100,000).
The same problem is solved now by using column dropping-rule. The rule asks to bring
the goal rows associated with all the goals in a simple tableau, as shown below. LP1
(maximizing broadcasting range). The simple tableau LP1 carries both the goal lines P1 and
P2. The optimal condition only applies to the destination row P1. P2-rows play a passive role
in LP1 but must be updated (using simplex row operations) with other simplex tableaus in
preparation for LP2 optimization. LP1 is completed in two iterations as follows:
The last table gives optimal solutions x1 = 0, x2 = 5, and P1 = 40. The column dropping-
rule calls for removing the non-basic variable xj with zj – cj 0 from the optimal tableau LP1
before LP2 is optimized. The reason is that these variables, if left unchecked, can be positive
in low priority optimization problems, which can degrade the quality of higher priority
solutions.
72
Table 8.4 Iterations 1 and 2
Optimal solution (x1= 6, x2=2) with total broadcasting coverage P1=40 and total cost P2=96.
After modelling according to the principle of goal programming, the formulation can
be completed by linear programming. Linear programming can basically be done in Python.
Here is a simple example of solving it in Python.
73
74
Figure 8.1 Solution using python
8.4 Case Examples of Risk Identification and Evaluation Using Fuzzy FMEA in the
Shrimp Agroindustry Supply Chain
One of the challenges in implementing the shrimp agro-industry business process is the
problem of variations in quality, quantity and continuity of raw materials that result in product
variations, thereby reducing global competitiveness. This problem is also an obstacle for supply
chain actors to collaborate with other actors. Therefore, the shrimp agroindustry is faced with
complex problems and is susceptible to various kinds of disturbances. Research conducted by
Djatna et al (2020) answers this challenge by creating a risk identification and analysis model
to identify the risks of each supply chain actor and choose actions based on priorities. Risk
identification is carried out with a what-if analysis approach and risk evaluation using a fuzzy
FMEA model. The results obtained from this study indicate that supply chain actors, namely
farmers, have the highest risk with the greatest probability level compared to the risk at the
level of traders and agro-industry risks. Overall this model can be used to identify risk factors
and variables at each level of the supply chain and choose priority actions so that
recommendations will be obtained in the form of appropriate actions to anticipate them.
75
76
CHAPTER IX
LINEAR PROGRAM TEHNIQUE: TRANSPORTATION AND ASSIGNMENT
MODELS
The learning objectives of chapter IX are expected that students are able to:
1. Understand and differentiate the concept of transportation with assignments
2. Using the principles of transportation and assignment in simple case examples
3. Applying transportation models to non-traditional cases such as PPIC and machine or
equipment service
4. Understand and compare algorithm (Northwest-corner, Least-cost, and Vogel
approximation method), and implement it to solve transportation problems.
77
5. a13 x13 + a23 x23 + a33 x33 d3
6. a14 x14 + a24 x24 + a34 x34 d=
7. for all xijand xji0, where i = 1,2,3; and j = 1,2,3,4.
Based on the example above, we can see that there are several properties such as:
1. Has objective function
2. Has constraint function
3. Has a non-negativity constraint
4. A number of variable and the constraints are linearly related.
This shows that the transportation model is one type of problem from linear
programming. However, in transportation problems, the objective function in general is
minimization. The solution to transportation problems is generally done by algorithm
transportation which will be explained further in the next sub-chapter. This is because it will
be very difficult if it is solved by the simplex method as in the case of ordinary linear
programming.
The steps to solve the above problems using the Northwest-corner method are as follows:
1. Show the problem in the matrix. In the picture above, the matrix is formed from the supply
of production by 1,2,3 and demand from 1,2,3. Each is written on the right and bottom.
2. To get started with this method, always start with the first fill in the path in the top left
corner. Filling or allocating goods on this line must be guided by the existing production
capacity (supply) and the number of requests (demand) that must be met.
3. When the demand has not been met, then the steps continue to the bottom box until all
demands are met. When the demand has been met, it can be continued to the right, to the
next box and fulfill the next demand. Do a zigzag movement from the top left corner to the
bottom right, until all the goods produced are distributed and meet all existing requests.
78
4. After that, the optimality test was carried out by looking for the value of U (row) and V
(column). This test is carried out until all non-basic variables become negative.
V1 = V2 = V3 =
5 10 20
Suppl
A B C y
A 5 10 10 60
U1 = 0 50 10 x
10
B 15 20 15 80
U2 =
10 x 80 x
0 15
C 5 10 20 70
U3 = 0 x 10 60
0 0
Deman
d 50 100 60
Figure 9.2 Completion of the Northwest-corner method
The variable x is replaced with a variable by forming a loop through the basic variable
So that :
V1 = V2 = V3 =
5 10 5
Suppl
A B C y
A 5 10 10 60
U1 = 0 50 10 x
-5
B 15 20 15 80
U2 =
10 x 20 60
0
C 5 10 20 70
U3 = 0 x 70 x
0 0
Deman
d 50 100 60
Figure 9.3 Completion of the Northwest-corner method
5. The total cost is calculated by multiplying the basic variable by the cost.
So, the resulting solution from the Northwest-corner method is:
So that the total costs incurred are:
z = (50 * 5) + (10 * 10) + (20 * 20) + (70 * 10) +( 60 * 15) = $2350
79
9.1.2 Least-cost Method on Transportation Problem
Least-Cost is a method that can be done in addition to using the Northwest Corner
method. Least-Cost on principle do a systematic allocation to the boxes based on the minimum
transportation costs. So this method targets to choose the cheapest route as a better initial
solution. By using the same case as the previous method, we can work on the solution as shown
below:
A B C SUPPLY
A 5 10 10 60
50 10 x
B 15 20 15 80
X 20 60
C 5 10 20 70
X 70 x
DE
MA
ND 50 100 60
Figure 9.4 Solving the Least-cost method
80
Figure 9.5 Solving the Least-cost method
From the three methods above we can already see the different stages that need to be done from
each method. Besides having an effect on the case resolution process, the selection of this
method can also affect the results given for some cases.
Completion of transportation methods using POM-QM
1. Open the POM-QM application, and select transportation on the available modules
2. Create data set, and fill in according to the problem to be solved
81
3. After that, enter the cost, supply, and demand data in the column
4. Select the starting method you want to use, then click solve, so that the most optimum
results appear
82
9.1.4 Non-traditional Transport Model
The application of the transportation model is not limited to the transportation of goods.
The following is an example application non-traditional in the field of production and inventory
control.
Boralis manufactures backpacks for climbers. The demand for its products during the
peak period of March to June each year is 100, 200, 180, and 300 units, respectively.
Companies use part-time workers to accommodate fluctuations in demand. It is estimated that
Boralis can produce 50, 180, 280 and 270 units in March to June. This month's request may be
fulfilled in one of three ways.
1. This month's production costs $40 per pack.
2. Surplus production in the previous month incurs an additional storage fee of $0.50 per pack
per month
3. Surplus production in the following month (back-order) is subject to an additional penalty
fee of $2.00 per pack per month.
Boralis wants to determine the optimal production schedule for four months.
The following table summarizes the equivalence between the elements of the
production inventory problem and the transportation model:
Example calculation:
C11= $40.00
C24= $40.00 + ($.50 + $.50) = $41.00
C41= $40.00 + ($2.00 + $2.00 + $2.00) = $46.00
83
The optimal solution is summarized in the image below. The dotted line shows
backorder, the dotted line shows production for the future period, and the straight line shows
production in the period itself. The total cost is $31,455.
84
or cost of creating all jobs by allocating one job to one machine. Because of this character, the
assignment matrix is always a square matrix. Once the matrix is square, we can use algorithm
assignment of Flood technique or Hungarian Method (will be explained further in the next sub-
chapter) to solve problems as below.
85
The assignment problem will be solved using the Hungarian Method, through the
following steps.
Step Determine pi, the minimum cost element of row i in the original cost matrix, and
1 subtract from all row elements i, i = 1, 2, 3.
Step For the matrix created in step 1, determine qj, the minimum cost element of column
2 j, and subtract from all elements of column j, j = 1, 2, 3.
Step From the matrix in step 2, try to find a feasible assignment among all the resulting
3 zero entries.
3a. If such an assignment can be found, it is optimal.
3b. Otherwise, additional calculations are required.
The cell with the zero-entry underlined in step 3 provides the optimal (possible)
solution: John gets the paint job, Karen mows the lawn, and Terri washes the family car. The
total cost for Mr. Klyne is 9 + 10 + 8 = $ 27. This amount will also always be equal to (p 1+ p2+
p3) + (q1+ q2+ q3) = (19 + 9 + 82) + (10 + 1 + 0) = $27.
86
9.3 Comparison of Transport and Assignment Models
Fellow is based on linear programming model of transport and assignment has some
similarities and differences.
• Equality:
1. Both are special types of programming problems linear.
2. Both have function objective, constraint functions, and non-negative constraints, as
well as the relationship between variables and constraints are linear.
3. The coefficient of the variable in the solution will be 1 or zero in both cases.
4. Both are basically minimization problems.
Difference:
Transportation Assignment
The problem matrix can be in the form of a The problem matrix must be in the form of
rectangular matrix or a square matrix a square matrix
Rows and columns can have any number of Rows and columns must have a one-to-one
allocations allocation (because of the square matrix)
A feasible base solution should have an Each column and row must have at least one
allocation of m + n - 1. zero. And one machine is assigned to one
job and vice versa.
In transportation problems, a common A common problem faced is the division of
problem is the movement of one commodity tasks from one job or machine to another
from various origins to various destinations. machine or job
Table 9.4 Comparison of transportation and assignment models
87
88
CHAPTER X
LINEAR PROGRAM TECHNIQUES: NETWORK ANALYSIS FOR TSP,
MAXIMUM FLOW, MINIMUM FLOW AND MULTI-COMMODITY FLOW
Learning Objectives Chapter X is expected that students are able to:
1. Understand network analysis in programming techniques linear.
2. UsealgorithmKruskal, Prim's and Boruvka in solving minimum problems spanningtree
3. Explaining TSP Rules, Maximum Flow, Minimum Cost Flow, Multi-Commodity Flow and
their Applications in the Real World.
89
the least weighted edge connecting a vertex in C to one outside C, we are confident that we
will always add a valid edge to the MST.
90
10.1.3. Boruvka Algorithm
The idea behind this algorithm is quite simple and intuitive, this algorithm can also be
called the Greedy algorithm. This algorithm can determine the minimum spanning tree on
directed graphs and undirected graphs.The algorithm starts by finding the minimum weighted
edge incidence to each vertex of the graph, and adding all those edges to the tree. Then, it
repeats a similar process to find the edges with the minimum weight from each tree built so far
into a different tree, and adds all those edges to the tree. Each iteration of this process reduces
the number of trees, in each connected graph component, to at most half its previous value, so
after many logarithmic iterations, the process is complete. When that happens, the set of edges
that have been added forms a minimum spanning forest.
1. Number of Cities, N.
2. Distance Dij Between Cities I And J (Dij = If Cities I And J Are Not Connected).
The maximum number of tours in an n-city situation is (n – 1)! if the network is specified (i.e.,
dij dji), or in other words the vehicle does not pass the same lane twice (back and forth), and
half otherwise.
91
In fact, the application of tsp goes far beyond the classic definition of visited cities. The
real-life application given in this chapter is to describe mission planning for synthetic aperture
radar surveillance.
One application of TSP in the industrial world is in the manufacture of printed circuit
boards (PCBs) for electronics. Circuit boards have many tiny holes through which chips and
other components are connected. for example, several hundred holes may have to be drilled up
to 10 different sizes. efficient manufacturing requires that these holes be completed as quickly
as possible with a moving drill. so, for any single measure, the question of finding the most
efficient drilling sequence is a matter of TSP.
92
With Constraint Function:
Constraints (1), (2), and (3) define a regular assignment model (discussed in Chapter 9) where
xij = 1 if node (city) i is connected to node (city) j, and zero otherwise. If the assignment model
solution forms a round trip tour with a number of n cities, it is automatically optimal for tsp.
This is rare, however, the assignment model is likely to consist of subtours. Additional
calculations are then required to determine the optimal touring solution. The im age below
shows TSP 5 cities with tours and sub-tour solutions. Nodes represent cities, and lines represent
two-way routes which can be different if the TSP is asymmetric.
93
Figure 10.8 Illustration of a pipeline
An example of applying the path augmentation algorithm to the maximum flow problem.
94
Starting with the initial residual network given in the figure below, a new residual
network is given after every one or two iterations, where the total number of flows from
o to t achieved so far is shown in bold (next to nodes o and t).
Iteration 1: in figure 10.7, one of the several augmentation paths is O-B-E-T, which has
a residual capacity of min {7, 5, 6} = 5. By assigning flow 5 to this path, the resulting
residual network is
Iteration 2: assign flow 3 to the augmentation path O-A-D-T. The resulting residual
network is
Iteration 4: assign flow 2 to the augmentation path O-B-D-T. The resulting residual
network is
95
Figure 10.12 Iteration 4
Iteration 6: assign flow 1 to the O-C-E-T augmentation path. The resulting residual
network is
Iteration 7: assign flow 1 to the O-C-E-B-D-T augmentation path. The resulting residual
network is
96
Figure 10.15 Solvering with Solver in Microsoft Excel
The figure above shows the spreadsheet formulation for the maximum flow problem in
the previous example. The arcs/lines are listed in columns b and c, and the corresponding
arc capacities are given in column f. Since the decision variable is the flow through the
respective arc, this sum is included in the changing cell flow (d4:d15). Using the equation
given in the lower right corner of the figure, this flow is then used to calculate the
resulting net flow at each node (see columns h and i). This net flow must be 0 for the
transhipment nodes (a, b, c, d, and e), as indicated by the first set of constraints (i5:i9
supply demand) in the solver. The second set of constraints (capacity flow) determines
the arc capacity limit. The total amount of flow from the source (node o) to the sink (node
t) is equal to the flow generated at the source (cell i4), so the maxflow destination cell
(d17) is set equal to i4. After determining the maximization of the target cell and then
running the solver, the optimal solution shown in the stream (d4:d15) is obtained.
97
3. At least one of the other nodes is a request node.
4. All remaining nodes are transhipment nodes.
5. Flow through the arc/line is only allowed in the direction indicated by the arrow,
where the maximum amount of flow is given by the arc's capacity. (if flow could
occur in both directions, this would be represented by a pair of arcs point ing in
opposite directions.)
6. The network has sufficient arcs/lines with sufficient capacity to allow all generated
flows at the supply nodes to reach all demand nodes.
7. The cost of flow through each arc/line is proportional to the amount of that flow,
where the cost per unit of flow is known.
8. The objective function of the minimum cost flow case is to minimize the total cost of
shipping available supplies over the network to satisfy a given demand. (the
alternative goal is to maximize total profit).
Model formulation
Consider a directed and connected network where n nodes include at least one supply
node and at least one demand node. The decision variable is
xij= flowing through an arc or line i→ j
And given the information:
cij= cost per unit flow through an arc or line i→ j
uij= arc or line capacity for arc i→ j
bi= net flow generated at the node i
98
Its objective function is to minimize the total cost of shipping available supplies over
the network to meet a given demand. Using the convention that the sum is taken only from the
given arcs, the linear programming formula for this problem is:
Example:
The picture above shows an example of a Minimum Cost Flow case from a company. The
value of bi in the figure is shown in square brackets by nodes, so that the supply nodes (bi > 0)
are a and b (two company factories), the demand nodes (bi < 0) are d and e (two shrimp), and
one node transhipment (bi = 0) is c (distribution centre). The cij value is displayed next to the
arc. In this example, all but two arcs have arc capacities in excess of the total resulting flow
(90), so test for all practical purposes. The two exceptions are arc a b, where uab = 10, and arc
c e, which has uce = 80.
99
Constraint function:
And
This problem will be solved using the excel solver as shown below. The shrimp format is the
same as that shown in the previous maximum flow case. In this case the unit cost (cij) needs to
be entered (in column g). Since the value of bi is determined for each node, a net flow constraint
is required for all nodes. However, only two bows require a bow capacity limitation. The total
cost destination cell (d12) now gives the total cost of flow (delivery) through the network (see
the equation at the bottom of the figure), so the goal defined in the solver is to minimize this
quantity. The cells that change send (d4:d10) in this spreadsheet represent the optimal solution
obtained after running the solver.
100
Let us express the flow of commodity K on the arc (i, j), then and express the flow and
the cost vector per unit commodity K. Using this notation we can formulate the
multicommodity flow problem as follows:
(10.a)
Subject to
(10.b)
(10.c)
(10.d)
This formulation has a set of ordinary mass balance constraints K (10.c), modelling the flow
of each commodity k = 1, 2, …, K. The “shrimp” constraint (10.b) binds the commodity by
constraining the total flow of all commodity in each arc (i, j) to at most uij. Note
that we also impose individual flow limits on commodity flows k on arcs (i, j). Many apps don't
enforce this limitation, so for this app we set each bound to + ∞. Although it is possible to
formulate alternative multicommodity models with different assumptions, we will refer to these
models as the multicommodity flow problem.
(10.b')
The slack variable Sij for the bow (i, j) measures the unused capacity of the shrimp in that
arc.
The problem of multi-commodity flow can be even greater. For example, each node
wants to send a different message to every other node, 1,000,000 messages, 1,000,000
commodities and 10 billion variables (10,000 variables per commodity). Multi-commodity
flow can be practiced in various fields, including manufacturing networks, road and rail
transportation networks, air transportation networks and communication networks.
101
10.6 Multi-Commodity Flow Application In Seasonal Product Warehousing
A company produces many products. Products are seasonal, with demands varying
weekly, monthly, or quarterly. In order to use its labor and capital equipment efficiently, the
company wants to “smooth” production, saving pre-season production to complement peak-
season production. The company has shrimp with a fixed capacity R which is used to store all
the products it produces. The decision problem is to identify the level of production of all
products for each week, month, or quarter of the year that will allow to meet the demands that
arise as production and storage costs are kept to a minimum. We can view this warehousing
problem as a multi-commodity flow problem defined on the appropriate network. To facilitate,
consider a situation where a company manufactures two products and it needs to schedule its
production for each of the next four quarters of the year. Suppose and express the demand for
products 1 and 2 in quarter j. Let the production capacity for the jth quarter be and, and the unit
production costs for this quarter are and suppose and express the cost of holding (holding) the
two products from quarter j to quarter j + 1.dj1dj2uj1uj2cj1cj2ℎj1ℎj2
Figure 10.2 shows the network that corresponds to the warehousing problem. The
network contains one node for each time period (quarter) as well as source and sink nodes for
each commodity. Supply and demand from source and sink nodes is the total demand for the
commodity over the four quarters. Each source node sk has four outgoing arcs, one
corresponding to each quarter. Only one commodity flows on each of these arcs. We associate
cost and capacity with arc (sk, j). Similarly, the sink node tk has four incoming arcs; The
sinking arc (j, tk) has zero cost and a capacity of the remaining arcs are of the form (j, j + 1)
for j = 1, 2, 3; The flow in these arcs represents the units stored from period j to period j + 1.
Each of these storage arcs has a capacity R,cjkujkdjkℎj1ℎj2
It is easy to see that each feasible multicommodity flow x in the network determines a feasible
production and inventory schedule for two products with the same product cost as flow x. By
optimizing multi-commodity flows, we find optimal plans for production and inventory. The
warehousing problem we are considering is a relatively simple model; We can increase it to
include more realistic complexities: for example, the transportation costs that occur between a
combination of manufacturer-warehouse, warehouse-retailer, and factory-retailer.
102
10.7 Case Example of Network Analysis on Optimization of Forward-Backward
Logistics Delivery Scheduling
One of the challenges faced in scheduling forward and backward logistics deliveries is
minimizing transportation costs and maximizing order response. These two things are
conflicting goals. Research conducted by Djatna and Amien (2020), answered this challenge
using a non-dominant genetic sorting algorithm on the Integrated Reverse Logistic Problem
(IRLP) to optimize delivery scheduling problems. The research resulted in a proposed model
that satisfies two conflicting objectives and meets the existing constraints so that the delivery
scheduling case has been optimal. The proposed model promises to improve the performance
of the logistics system because it is able to minimize transportation costs while increasing
order response.
103
104
CHAPTER XI
LINEAR PROGRAM TECHNIQUES: CPM/PERT/PDM NETWORK ANALYSIS
The learning objectives of chapter XI are expected that students are able to:
1. Understand the concept of a network using the CPM/PERT/PDM method
2. Applying the CPM/PERT/PDM method on simple problems
3. Analyzethe use of the CPM/PERT/PDM method in the appropriate agro-industry case
105
PERT has a goal to achieve a project completion, where time is an important basis for
completing its activities. PERT and CPM are to solve problems related to determining the
schedule of a project's activities, the budget for each work that has been scheduled so that
project activities can be completed on time and on cost. The benefits of implementing the PERT
method are as follows:
• Knowing the dependencies and interrelationships of each job in a project.
• Can know the implications and timing if there is a delay in a job.
• Can find out the possibility to find other better alternative paths for the smooth running
of the project.
• Can find out the possibility of acceleration of one or several activity lines.
• Can know the deadline for project completion.
The basis of the PERT method, namely the critical path. By knowing this critical path, the
completion time of a project can be minimized. The characteristics of the critical path are:
• The path that usually takes the longest in a process.
• A path that does not have a grace period between the completion of one activity stage
and the start of the next activity stage.
• The absence of such a grace period is the critical nature of the critical path.
Steps for planning with PERT:
1. Identify the activity (activity) and the point of departure (milestone).
2. Determine the order of execution of the activities that have been planned.
3. Make a network diagram (network diagram).
4. Estimate the time required for each activity.
5. Specifies a critical path (critical path).
6. Update the PERT diagram in accordance with the progress of the project.
7. PERT Karakteristik characteristics
106
• Count Forward
Starting from Start (initial event) to Finish (terminal event) to calculate the fastest
completion time of an activity (EF), the fastest time for an activity to occur (ES) and
the fastest time to start an event (E).
• Countdown
Starting from Finish to Start to identify the latest time an activity occurs (LF), the latest
time an activity occurs (LS) and the latest time an event occurs (L).
If the two calculations have been completed, the Slack or Float value can be obtained
which is a number of time allowances and elasticity in a network. There are two types of Slack,
namely Total Slack and Free Slack. To perform forward and backward calculations, the circle
or event is divided into three parts, which are:
An example of calculating the amount of project completion time and its total slack.
107
Forward Calculation
• First Rule
Except for the initial activity, a new activity can be started when the preceding activity
(predecessor) has been completed.
E(1) = 0
• Second Rule
The earliest finish time for an activity is the same as the earliest start time, plus the
period of activity that precedes it.
EF(ij) = ES(ij) + t(ij)
Then: EF(1-2) = ES(1-2) + D = 0 + 2 = 2
EF(2-3) = ES(2-3) + D = 2 + 5 = 7
EF(2-4) = ES(2-4) + D = 2 + 3 = 5
EF(3-5) = ES(3-5) + D = 7 + 6 = 13
EF(4-5) = ES(4-5) + D = 5 + 4 = 9
• Third Rule
If an activity has two or more previous activities that combine, then the earliest start
time (ES) of the activity is the same as the largest finish time (EF) of the previous
activity. For example:
Countdown
• Fourth Rule
The latest start time for an activity is the same as the latest finish time minus the time
period for which the activity took place.
LS(ij) = LF(ij) – t
Then LS(5-6) = EF(5-6) – D = 16 – 3 = 13
108
LS(4-5) = EF(4-5) – D = 13 – 4 = 9
LS(3-5) = EF(3-5) – D = 13 – 6 = 7
LS(2-4) = EF(2-4) – D = 9 – 3 = 6
LS(2-3) = EF(2-3) – D = 7 – 5 = 2
• Fifth Rule
If an activity is split into 2 or more activities, then the latest activity time (LF) is the
same as the last smallest start time (LS) of the next activity.
109
PERT
Before learning more about PERT, we must understand a few things, such as arrows
that are used to represent an activity and knots or (codes) are used to represent events.
NO Rule Illustration
110
Examples of some activities are known with the following conditions. Determine the critical
path and its slack.
• Activities A, B, C joint activities
• Activity A precedes activity D
• Activity B precedes activities E, F and G
• Activity C precedes activity G
• Activities D and E precede activities H and J
• Activity F precedes activity I
Critical Path
Path A,D,H = 10 + 22 + 8 = 40
Path A,D,J = 10 + 22 + 15 = 47
Path B,E,H = 8 + 27 + 8 = 45
Path B, E, J = 8 + 27 + 15 = 50 → Critical path
Path B,F,J = 8 + 27 + 20 = 35
Path B,G,J = 8 + 15 + 15 = 35
Line C,G,J = 12 + 15 + 15 = 42
111
Critical path algorithm is to determine the critical path is done by calculating the fastest start
time (earliest start time) for each activity and the longest finish time (latest finish time)
.
Figure 11.7 Critical Path Algorithm
PDM
In using the PDM method, we need to first understand the constraints and identify the
critical path. As previously discussed, as a method of describing activity through stains, there
are several constraints in PDM, including:
112
NO Constraint Name Illustration Example
Case Example: It is known that a project consists of 6 activities with the timeframe and
constraints between the related activities attached in the table below.
113
The working steps of the PDM method:
1. Make a stain plan according to the number of activities
114
Choose the largest, then ES(3) = 7
EF(3) = ES(3) + D(C) = 7 + 6 = 13
• D activities
ES(4) = ES(2) + SF(2-4) - D(D) = 3 + 11 - 7 = 7
EF(4) = ES(4) + D(D) = 7 + 7 = 14
• E Activities
ES(5) = ES(4) + SS(4-5) = 7 + 4 = 11
ES(5) = EF(2) + FS(2-5) = 9 + 1 = 10
ES(5) = ES(3) + SF(3-5) - D(E) = 7 + 9 - 6 = 10
EF(5) = ES(5) + D(E) = 11 + 6 = 17
• F Activities
ES(6) = ES(5) + SS(5-6) = 1 1 + 5 = 16
EF(6) = ES(6) + D(F) = 16 + 8 = 24
115
• D activities
LF(4) = LS(5) - SS(4-5) + D(D) = 11 - 4 + 7 = 14
LS(4) = LF(4) - D(D) = 14 - 7 = 7
• C activities
LF(3) = LF(5) - SF(3-5) + D(C) = 17 - 9 + 6 = 14
LS(3) = LF(3) - D(C) = 14 - 6 = 8
• B . Activities
LF(2) = LF(3) - FF(2-3) = 14 - 2 = 12
LF(2) = LS(5) - FS(2-5) = 11 – 1 = 10
LF(2) = LF(4) - SF(2-4) + D(B) = 14 - 11 + 6 = 9
Choose the smallest then LF(2) = 9
LS(2) = LF(2) - D(B) = 9 - 6 = 3
• Activity A
LF(1) = L5(2) - 55(1-2) + D(A) = 3 - 3 + 5 = 5
LF(1) = L5(3) - F5(1-3) = 8 - 2 = 6
LS(1) = LF(1) - D(A) = 5 - 5 = 0
There is a difference in the results between the count forward and backward in activity C, so
activity C is not a critical activity. So that the critical path path is obtained:
116
CPM Completion Using Python
Sample case:
Information Name Predecessor Day
TASKA A 16
TASKB B A 10
TASKC C B 18
TASKD D A 24
TASKE E C 20
TASKF F C 12
TASKG G DF 22
TASKH H EG 14
117
Figure 11.15 main.py
118
CPM/PERT Completion Using ProjectLibre
ProjectLibre isproject management softwareOpen source, it runs on the Java
platform, which allows it to run on various operating systems. It is currently the main open
source alternative to Microsoft Projects. ProjectLibre is fully compatible with Microsoft
Project 2003, 2007 and 2010 files. The program has been adopted in more than 200 countries
and major companies. With this, governments, small businesses and non-profit organizations
around the world benefit from its functions. ProjectLibre's goal is to provide free and open
source project management software worldwide and provide comprehensive project
management features. ProjectLibre works very similarly to Microsoft Project, it has a fairly
intuitive user interface, easy to use and similar to MS Project, it offers some very complete
functions. With it we can create Gantt charts and PERT charts. In addition we can also create
RBS diagrams, resource analytical structures, and WBS diagrams, from the work
decomposition structure. In comparison, Microsoft Project has complete menus and is very
user-friendly. However, Microsoft Project is a paid application.whereasProjectLibre is a free
application.
119
Figure 11.18 ProjectLibre Homepage
You can download the ProjectLibre app athttps://sourceforge.net/projects/projectlibre. You can
see the installation video and how to use it onhttp://ipb.link/material-responsi-po.
120
D Testing the prototype to the market 2 B
Write an evaluation report on the
E 5 CD
equipment used
F Write a report on the method used 8 CD
G Write the final report 2 E,F
Table 11.7 Event Lists
Furthermore, to find out the time needed, it is necessary to form a network first and the
calculation is as follows:
Count Forward
121
122
CHAPTER XII
APPLICATION OF NETWORK ANALYSIS WITH SEVERAL VARIETIES OF
CASE APPROACH
Learning Objectives of Chapter XII are expected that students are able to:
1. Analyzing network cases in agroindustry
2. Applying several network methods as an approach to solving problems in agroindustry
3. Evaluating network analysis methods in solving an agro-industry problem
Could this project be completed in just 50 days? In this case, we will use PERT in solving
the problem. After getting the TO, TL and TP values, it can be calculated TE and the standard
deviation and variance, namely:
123
Table 12.2 Calculation in problem solving
According to initial estimates, it is known that the project will be completed within 60
days. However, to see if the project can be accelerated, we can calculate whether there are
activities that can be accelerated. By doing the calculations, namely:
124
From this short calculation, it can be seen that there are 2 days of time that can be
shortened. So, the calculation continues up to activity 80.
It is known that the project execution time is 52 days, with a critical path of 10-20-30-70-
80.
Then, to find out the possibility of completing the project within 50 days, it is necessary
to look for opportunities. This is obtained from finding the root of the sum of the variances of
activities on the critical path. Then look for the time difference between TL and TE. The next
step is to determine the ratio value of (TL-TE) divided by the root of the number of variances
that have been found. Meanwhile, a TL value greater than TE will indicate a + value of the
ratio, and vice versa to be negative.
125
Table 12.4 Distribution standard function
Then it is found that the probability of occurrence is around 20%. This shows that it is
difficult to complete the project within 50 days. So it is necessary to inform the owner of the
company that it will be more likely to make a plan with a project completion time of 52 days
compared to 50 days.
126
production capacity of the wafers at the factory. The following are activities carried out in or der
to multiply this scale:
A : Determination of wafer production specifications and planning
B : Construction of a new building
C : Recruitment of technicians and employees
D : Employee training
E : Purchase of components and production equipment
F : Production preparation
G : Communication with suppliers and stakeholders
Based on the information above, how long will it take to complete the project? Is 22
weeks enough to work on the project?
The first thing to do to solve the above problem is to find the variance of each activity:
127
Then, we can describe the network of activities in this project, namely:
After calculating, it can be seen that there are two critical paths, from here we can compare the
two:
Table 12.7 Calculation of the probability Table 12.7 Calculation of the probability
of completion of the path 1 project of completion of the path 2 project
It can be averaged that the probability of completion within 22 weeks is 49%, which
means that it’s better to do a plan with a probability of completion above more than 22 weeks.
128
129
CHAPTER XIII
DYNAMIC PROGRAMMING
Learning Objectives Chapter XIII is expected that students are able to:
1. Understand the concept of dynamic programming
2. Understand the recursive nature of dynamic programming
3. Using dynamic programming concepts in simple case examples
4. Analyze the function/purpose of dynamic programming in several cases
Operational inquiry models generally have the goal of finding optimal problem solving
solutions based on the value of the decision variable. Decision variables are variables that can
be controlled and changed by decision makers. One model of a problem that can be solved in
multiple stages by dividing the problem into smaller parts (decomposition) and at the final
stage producing a solution answer by unifying the decisions at each stage (composition).
Dynamic programming is a solving technique to get answers to multistage problem
solving problems. Multi-stage programming is better known as Dynamic Programming,
because its function involves making decisions that pass through time. However, in other
situations where time is not a factor. The characteristics of dynamic programming problems
are:
1. The problem can be divided into several stages, where at each stage only one decision is
taken.
2. Each stage consists of a number of states associated with that stage. In general, the state is
a variety of possible inputs that exist at that stage.
3. The results of the decisions taken at each stage are transformed from the status in question
to the next status at the next stage.
4. The best decision at a stage is independent of the decisions made at the previous stage.
5. A recursive relationship that identifies the best decision for each state at stage k gives the
best decision for each state at stage k + 1.
130
6. The principle of optimality applies to this problem. Probabilistic dynamic programming is
different from deterministic dynamic programming. Deterministic dynamic programming,
the results in the next stage, are determined by the conditions and decisions in the previous
stage. Probabilistic dynamic programming, probability distribution and probability
distribution of future states are still determined by state and policy decisions in previous
states. Two characteristics of probabilistic dynamic programming are:
I. The next stage is not entirely determined by the state and decisions of the current stage,
but there is a distribution of possibilities for what will happen.
II. This probability distribution is still entirely determined by the state and decisions at the
current stage.
131
Figure 13.1 Travel illustration graph
Notes : The figure above represents the real distance between cities in km
You as an agro-industrialist are asked to choose the most efficient route to distribute the
processed seaweed!
Solution:
To solve this problem, we can use dynamic programming techniques to find the shortest route
• Step 1: Create a partition to divide the stages on the map
Figure 13.2 Graph illustration of the journey after the division of the area
From the graph above, we can divide the 5 stages for the graph area
• Step 2: Calculate the total distance between nodes in Area 1 and Area 2
Weight between nodes in area 1 and area 2
1. Bekasi – Subang = 83 + 0 = 83
2. Bekasi – Bandung = 108 + 0 = 108
132
• Step 3: Calculate the total distance between nodes in Area 2 and Area 3. Eliminate
routes that have the same destination nodes with the highest weight
Weight between nodes in area 2 and area 3
1. Bekasi - Subang - Indramayu = 83 + 96 = 179
2. Bekasi - Subang - Majalengka = 83 + 76 = 159
3. Bekasi – Bandung - Majalengka = 108 + 91 = 199
4. Bekasi – Bandung - Tasikmalaya = 108 + 110 = 108
It can be seen from the calculation above that there are 2 routes that both go to
Majalengka. Therefore, according to dynamic programming rules, we must eliminate one
of the routes to Majalengka. The way we choose the route to be eliminated is by
comparing and seeing which route is the longest from the two destinations. In this case
route no 3 has a longer distance than route no 2 so that route 3 is eliminated in the next
calculation.
• Step 4: Calculate the total distance between nodes in Area 3 and Area 4. Eliminate
routes that have the same destination nodes with the highest weight
Weight between nodes in area 3 and area 4
1. Bekasi - Subang - Indramayu - Pemalang = 83 + 96 + 175 = 354
2. Bekasi - Subang - Majalengka -Pemalang = 83 + 76 + 174 = 333
3. Bekasi - Subang - Majalengka -Purwokerto = 83 + 76 + 199 = 358
4. Bekasi – Bandung - Tasikmalaya -Purwokerto = 108 + 110 +143 = 361
It can be seen from the calculation above that there are 2 routes that are both heading
to Pemalang and Purwokerto. Therefore, according to dynamic programming rules, we
must eliminate one of the routes to Pemalang and Purwokerto. The way we choose the
route to be eliminated is by comparing and seeing which route is the longest from the
two destinations. There are 2 types of routes that are compared based on the destination
city. Route 1 and Route 2 are compared because they both go to Pemalang and Route 1
and Route 2 are compared because they both go to the city of Purwokerto. In this case
route no 1 has a longer distance than route no 2 so that route 1 is eliminated in the next
calculation. Likewise route 4 when compared to route 3, because route 4 has a longer
distance then route 4 will be eliminated from the next route.
• Step 5: Calculate the total distance between nodes in Area 4 and Area 5. Eliminate
routes that have the same destination nodes with the highest weight
Weight between nodes in area 3 and area 4
1. Bekasi - Subang - Majalengka -Pemalang – Semarang = 83 + 76 + 174 + 129 =
462
2. Bekasi - Subang - Majalengka -Purwokerto – Semarang = 83 + 76 + 199 + 187 =
545
There are only 2 routes left, namely route 1 and route 2. If we look at the weight
calculation, then route 1 is the shortest route and eliminates route 2.
133
• Conclusion
By doing calculations with a dynamic program, the route chosen to deliver processed
seaweed products is from Bekasi City - Subang City - Majalengka - Pemalang City -
Semarang City with a distance of 462 km.
13.4.2 Example of Problem Solving Using Dynamic Programming 0/1 Knapsack Problem
Question:
A porter enters a house. The poter was carrying a bag that could only carry 6 kg of goods.
Inside the house there are items A, B, C, D with the following details:
• Item A weighs 3kg, the value is $6
• Item B weighs 2kg, value is $5
• Item C weighs 5kg, the value is $9
• Item D weighs 4kg, the value is $8
The porter has 2 choices, namely bringing the goods or leaving the goods, cannot carry
half. What items should the porter bring for maximum results?
Answer :
Based on the analysis of the sample questions, a representation of the problem will be obtained,
are:
• n=4
• W=6
• b1 = 6
• b2 = 5
• b3 = 9
• b4 = 8
• w1 = 3
• w2 = 2
• w3 = 5
• w4 = 4
134
Information:
1. n : the number of items
2. W: the maximum total weight that can be carried
3. b : the benefit of item n
n
Mathematical Formulation:
• Max z : 6x1 + 5x2 + 9x3 + 8x4
• Constrain : 3x1 + 2x2 + 5x3 + 4x4 ≤ 6
• x1, x2, x3, x4 is 0 atau 1
The solution is carried out using dynamic programming principles, so it will the following
results were obtained
Capacity F1 F2 F3 F4 X1 X2 X3 X4
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 5 5 5 0 1 0 0
3 6 6 6 6 1 0 0 0
4 6 6 6 8 0 0 0 1
5 6 11 11 11 1 1 0 0
6 6 11 11 13 0 1 0 1
Table 13.1 Results
In the problem, it is known that there are 4 items, so that the solution can be done in 4
stages. The first stage (f1) is assumed to be only for the first item. The second stage (f2) of the
first and second items is considered, and the possibility of both being included. The third stage
(f3) of the first, second, and third items is considered, as well as the possible accumulation of
the three items. And the fourth stage (f4) all goods are considered, including the possibility of
accumulation of goods (eg the second and fourth goods are transported). Each stage is the
maximum of the existing value after being compared to the previous stage. So that the results
of the problem can be seen from the value of f4 (stage 4) at capacity 6, which is worth 13, with
the goods transported are the second (x2) and fourth (x4) goods.
135
13.4.6 Example of Problem Solving Using Dynamic Programming Workforce Size Model
Question:
A contractor estimates that the number of workers needed over the next 5 weeks is 5, 7,
8, 4, and 6 workers. The excess labor kept in the force will cost $300 per worker per week, and
new hires in any week will cost you a flat fee of $400 plus $200 per worker per week.
Answer:
Problem Data
• b1 = 5
• b2 = 7
• b3 = 8
• b4 = 4
• b5 = 6
• C1(xi – bi) = 3(xi – bi), xi > bi , i= 1, 2, …, 5
• C2(xi - xi-1) = 4 + 2(xi - xi-1), xi > xi-1, i = 1, 2, …, 5
• Cost functions of C1 and C2 in hundreds of dollars.
Solution:
a. Step 5 (b = 6)
5
X C (X – 6) + C (X – X ) Optimum Solution
4 1 5 2 5 4
X=65 F (X ) X 5 4 5
*
4 3 (0) + 4 + 2 (2) = 8 8 6
5 3 (0) + 4 + 2 (1) = 6 6 6
6 3 (0) + 2 (0) = 0 0 6
Table 13.2 Stage 5
b. Step 4 (b = 4)
4
X3 C (X – 6) + C (X – X ) + f (x )
1 5 2 5 4 5 4 Optimum Solution
X =4
4 X =4
4 X =4 4 F (X )
4 3 X 4
*
c. Step 3 (b3 = 8)
X2 C (X – 8) + C (X – X ) + f (X ) Optimum Solution
1 3 2 3 2 4 3
X=8 3 F (X ) X 3 2 3
*
7 3 (0) + 4 + 2 (1) + 6 = 12 12 8
8 3 (0) + 0 + + 6 = 6 6 6
Table 13.4 Stage 3
d. Step 2 (b2 = 7)
X2 C (X – 8) + C (X – X ) + f (X )
1 3 2 Optimum Solution
3 2 4 3
X=7 2 X=8 F (X ) X 2 2 1 2
*
136
e. Step 1 (b1 = 5)
X 3 C (X – 5) + C (X – X ) + f (X )
1 1 2 1 0 2 1 Optimum
Solution
X =4
1 X =41 X =41 X=8
1 F (X )
1 0 X 1
*
Given that the machine is t years old at the beginning of year i, determine
fi(t) = maximum net income for years i, i + 1, …, and n
The recursive equation is as follows
137
13.4.8 Example of Troubleshooting Using Dynamic Programming Equipment
Replacement Model
Question:
A company has a policy regarding the optimal replacement procedure for machines that
are currently 3 years old, for the next 4 years (n = 4) . When the engine is 6 years old, the
engine must be replaced. The price of a new machine is $100,000. The following table provides
data for known issues:
Age, t (yr) Income, r(t) ($) Operational Cost, r(t) ($) Salvage Value, s(t) ($)
0 20.000 200 -
1 19.000 600 80,000
2 18.500 1200 60,000
3 17.200 1500 50,000
4 15.500 1700 30,000
5 14.000 1800 10,000
6 12.200 2200 5000
Table 13.8 Examples of problems
Problem Analysis:
Determining the feasible value of engine life at each stage is a bit complicated. The
graph below summarizes the network that represents the problem. At first year 1, we have a 3
year old machine. We can replace it (R) or keep it (K) for another year. If replacement occurs,
the new machine will be 1 year old at the beginning of year 2; otherwise the stored machine
will be 4 years old. The same logic applies at the beginning of years 2 to 4. If a 1 year old
machine is replaced at the beginning of years 2, 3, and 4, the replacement is 1 year at the
beginning of the following year. Also, at the beginning of year 4, the 6 year old engine had to
be replaced, and at the end of year 4 (end of the planning horizon), we saved (S)the engine.
The network shows that at the beginning of year 2, the probable ages of the machine
are 1 and 4 years. For the start of year 3, the possible ages are 1, 2, and 5 years, and for the
beginning of year 4, the possible ages are 1, 2, 3, and 6 years. The network also assumes that
machines will be salvaged as early as 5 years regardless of age.
Solution:
The network solution in the graph above is equivalent to finding the longest route (i.e.,
maximum revenue) from the beginning of year 1 to the end of year 4. We will use a form table
to solve the problem. All values in thousands of dollars. Note that if an engine is replaced in
year 4 (that is, the end of the planning horizon), the revenue will include the salvage value, s(t),
of the replaced engine and the salvage value, s(1), of the replacement engine. Also, if in year 4
a machine of age t is stored, the residual value is s(t + 12).
Step 4.
t K R Optimum Solution
r(t) + s(t+1) – c(t) R(0) + s(t) + s(1) – c(0) - I f4(t) Decision
1 19.0 + 60 - 0.6 = 78.4 20 + 80 + 80 - 0.2 - 100 = 79.8 79.8 R
2 18.5 + 50 - 1.2 = 67.3 20 + 60 + 80 - 0.2 - 100 = 59.8 67.3 K
3 17.2 + 30 - 1.5 = 45.7 20 + 50 + 80 - 0.2 - 100 = 49.8 49.8 R
6 Must be change 20 + 5 + 80 - 0.2 - 100 = 4.8 4.8 R
Table 13.9 Stage 4
138
Step 3.
t K R Optimum Solution
r(t) – c(t) + f4(t + 1) r(0) + s(t) – c(0) - I + f4(1) F3(t) Decision
1 19.0 + 60 - 0.6 = 78.4 20 + 80 - .2 - 100 + 79.8 = 79.6 85.7 K
2 18.5 - 1.2 + 49.8 = 67.1 20 + 60 - .2 - 100 + 79.8 = 59.6 67.1 K
3 14.0 - 1.8 + 4.8 = 17.0 20 + 10 - .2 - 100 + 79.8 = 9.6 17.0 R
Table 13.10 Stage 3
Step 2.
t K R Optimum Solution
r(t) – c(t) + f3(t + 1) R(0) + s(t) – c(0) - I + f3(1) f2(t) Decision
1 19.0 - .6 + 67.1 = 85.5 20 + 80 - .2 - 100 + 85.7 = 85.5 85.5 K or R
2 15.5 - 1.7 + 17.0 = 30.8 20 + 30 - .2 - 100 + 85.7 = 35.5 35.5 R
Table 13.11 Stage 2
Step 1.
t K R Optimum Solution
r(t) – c(t) + f2(t + 1) R(0) + s(t) – c(0) - I + f2(1) f1(t) Decision
3 17.2 - 1.5 + 35.5 = 51.2 20 + 50 - .2 - 100 + 85.5 = 55.3 85.5 R
Table 13.12 Stage 1
At the beginning of year 1, given t = 3, the optimal decision is to replace the engine. Thus, the
new machine will be 1 year old at the beginning of year 2, and t = 1 at the beginning of year 2
requires maintenance or replacement of the machine. If replaced, the new engine will be 1 year
old at the beginning of year 3; otherwise, the machine stored will be 2 years. This process is
continued in this manner until the 4th year is reached.
1 0 0 0 0 0 0
2 1 5 2 8 1 3
3 2 6 3 9 - -
4 - - 4 12 - -
Table 13.13 Examples of problems
139
The Dynamic Programming elements of the above problem are as follows:
1. Stage consists of 3 according to the number of factories
2. State is the amount of project funds allocated to each factory
Step 1 (Factory 1)
Dana Fx1 Fx1* Fx1*
P1 P2 P3
0 0 0 P1
1 0 5 5 P2
2 0 5 6 6 P3
3 0 5 6 6 P3
4 0 5 6 6 P3
5 0 5 6 6 P3
Table 13.14 Stage 1
Step 2 (Factory 2)
Dana Fx1 Fx1* Fx1*
P1 P2 P3 P4
0 0 0 P1
1 5 5 P1
2 6 8 8 P2
3 6 13 9 13 P2
4 6 14 14 12 14 P2/P3
5 6 14 5 17 17 P3
Table 13.15 Stage 2
In the table, P1 is filled with fx1* or the maximum value from the previous stage. This
happens because in factory 2, project 1 (P1) has a value of 0, so that when compared with the
results of the previous stage, the previous value is greater. If the cost is still remaining, it may
be added to another project from the previous factory. For example in P2 fund 3, there is still
1 fund left so that it can be used for 2 factory 1 projects.
140
Make a definition I = x – I so i i i
x =P1 1
x = P + q , I + q , (x - I )
i i i-1 1 i-1 i-1 2 i-1 i-1
= P + (q , - q ) I + q , x , i = 2, 3,…….., n
i i-1 1 i-1, 2 i-1 i-1 2 i-1
The reinvestment amount xi includes only the new money plus the bonus from the investments
made in years i - 1.
Define:
fi(xi) = the optimal value of the investment for years i, i + 1, c, and n, given xi . Next, determine
si as the accumulated amount at the end of year n, given that Ii and (xi - II) are investments
made in year i in the First Bank and Second Bank, respectively. Letting ak = (1 + rk), k = 1, 2,
the problem can be expressed as follows
Maximize z = s + s + ……. + s
1 2 n
With
s = I a + (x - I ) a
i i 1
n+1-i
i i 2
n+1-i
= (a - a ) I + a x , i = 1, 2, ……. , n - 1
1
n+1-i
2
n+1-i
i 2
n+1-i
i
s = (a + q - a - q ) I + (a + qn )x
n 1 n1 2 n2 n 2 2 n
The terms q and q di s are added because the bonus for year n is part of accumulation of the
n1 n2 n
f (x ) = 0
n+1 n+1
f (x )
i i= max {s + f (xi+1)}, i = 1, 2, …… , n - 1
i i+1
0 I X ≤ i≤ i
Problem Analysis:
Using the notation introduced earlier, you have
• P = $4,000, P2 = P3 = P4 = $2000
1
• a = 11 + 0.082 = 1.08
1
• a = 11 + 0.0782 = 1.078
2
141
Solution:
Step 4
f (x )
4 4 = max {s }
4
0 I X ≤ 4≤ 4
With condition
s = (a + q - a - q ) I + (a + q ) x = -0.003I + 1.108x
4 1 41 2 42 4 2 42 4 4 4
Function s is a linear function with a range 0 I X and the maximum point occurs at I = 0
4 ≤ 4≤ 4 4
because the negative coefficient of I . So, the optimal solution for stage 5 can be summarized 4
as follows
State Optimum Solution
f (x ) I* 4 4 4
X 4 1.108x 0 4
Step 3
f (x )
3 3 = max {s + f (x )}
3 4 4
0 I X ≤ 3≤ 3
With condition
s = (1.08 - 1.078 ) I + 1.078 x = 0.00432I + 1.1621x
3
2 2
3
2
3 3 3
So,
f (x )
3 3 = max { 0.00432I + 1.1621x + 1.108 (2000 - 0.005I + 0.026x )} 3 3 3 3
0 I X ≤ 3≤ 3
0I X ≤ 3≤ 3
X 3 2216 + 1.1909x 0 3
Step 2
f (x )
2 2 = max {s + f (x )}
2 3 3
0 I X ≤ 2≤ 2
With condition
S = (1.08 - 1.078 ) I + 1.078 x = 0.006985I + 1.25273x
2
3 3
2
3
2 3 2
So,
f (x )
2 2 = max { 0.006985I + 1.25273x + 2216+ 1.1909 (2000 - 0.005I + 0.022x )}
2 2 3 3
0 I X ≤ 2≤ 2
0 I X ≤ 2≤ 2
142
State Optimum Solution
F (x ) 2 I*2 2
X 2 4597.8 + 1.27996x 0 2
Step 1
f (x )
2 2 = max {s + f (x )}
1 2 2
0 I X
≤ 1≤ 1
With condition
S = (1.08 - 1.078 ) I + 1.078 x = 0.01005I + 1.3504x
1
4 4
1
4
1 2 1
So,
f (x )
1 1 = max { 0.01005I + 1.3504x + 4597.8 + 1.27996 (2000 - 0.005I + 0.023x )}
1 1 1 1
0 I X
≤ 1≤ 1
0 I X
≤ 1≤ 1
x1 = 4000
x2 = 2000 - 0.005 x 4000 + 0.023 x 4000 = $2072
x3 = 2000 - 0.005 x 2072 +0.022 * 2072 = $2035.22
x4 = 2000 - 0.005 x 0 + 0.026 x $2035.22 = $2052.92
143
This categorization assumes the availability of reliable data to forecast future demand.
In terms of developing an inventory model, the first category is the simplest analytically, and
the fourth is the most complex. On the other hand, the first category is the least likely to occur
in practice and the fourth category is the most common. In practice, the goal is to balance model
simplicity and model accuracy. How can we decide whether a certain demand forecast is
acceptable? 2 The initial "estimated figure" is based on calculating the mean and standard
deviation.
Question:
A 4 ton ship can be loaded with one or more than three items. The following table gives unit
weight, wi, in tons and unit revenue in thousands of dollars, ri, for item i. The goal is to
determine the number of units of each item that will maximize the total return.
Item i Wi ri
1 2 31
2 3 47
3 1 14
Information:
Since the unit weight wi and the maximum weight W are integers, the state xi assumes integer
values only.
wi = weight of item i
ri = revenue item i
mi = number of items i (alternative)
xi = state / state item i
(-1111111) =indicates that the output is not feasible/impossible
144
Completion (Backward Recursion)
• Step 3. f 3(x3) = max m3=0,1,…4 {14m } 3
• Step 2.
f = max
2(x2) m2=0,1 {47m2 + f (x - 3 m )}
3 2 2
• Step 1
f = max
2(x2) m2=0,1,2 {31m + f (x - 2 m )}
1 2 1 1
145
13.5.2 Application of Python in Dynamic Programming Problem Solving
The concept of dynamic programming can also be applied to Python by using the
principle of recursive functions. Examples of problems that will be discussed are the Fibonacci
sequence and the 0-1 knapsack problem. The Fibonacci sequence is an arithmetic sequence
consisting of a series of simple numbers, where the sequence of numbers is the sum of the two
previous numbers (0, 1, 1, 2, 3, 5, 8, 13, 21,…etc). The Fibonacci sequence formula is usually
described as Un = Un-2 + Un-1, meaning that the nth term is the sum of the previous two terms.
Keep in mind that one of the important things in dynamic programming is the recursive nature.
So that its application in Python also needs to use recursive functions. For example, if you want
to find the value of the nth Fibonacci sequence, then the Python code is as follows: (Python
file can be downloaded at: http://ipb.link/material-responsi-po)
146
The status DP[i][j] will show the maximum value of 'j-weight' considering all values
from '1 to i'. So if we consider 'wi' (weight in 'i-th row') we can fill it in all columns which have
'weight value > wi'. Now two possibilities can occur:
Fill in 'wi' in the given column.
Do not fill in 'wi' in the given field.
Now we have to take maximum of these two possibilities, formally if we don't fill
weight 'i' in column 'j' then state DP[i][j] will be equal to DP[i-1][j] but if we fill weights,
DP[i][j] will be equal to the value of 'wi'+ the value of the column with the weight of 'j -wi' in
the previous row. So we take the maximum of these two possibilities to fill the current state.
This visualization will clarify the concept:
After understanding the calculation concept, here is the code for the problem in Python and the
output is 220:
147
Figure 13.6 Example of problem solving
148
ENDSETS
DATA:
STATE = S1..S10;
! Here are roads/moves and distances that correspond to the
moves that are available;
MOVE, D=
S1,S2,1 S1,S3,5 S1,S4,2
S2,S5,13 S2,S6,12 S2,S7,11
S3,S5,6 S3,S6,10 S3,S7,4
S4,S5,12 S4,S6,14
S5,S8,3 S5,S9,9
S6,S8,6 S6,S9,5
S7,S8,8 S7,S9,10
S8,S10,5
S9,S10,2;
! D( i, j) is the distance from city i to j;
ENDDATA
SUBMODEL DYNPROG:
! If you are already in State last state, then the cost to
travel to City 10 is 0;
F( STATESN) = 0;
149
NEXT1 = j;
);
@WRITE( @FORMAT( STATE(START1),'14s'),' to', @FORMAT(
STATE(NEXT1), '15s'), @NEWLINE(1));
START1 = NEXT1;
);
ENDCALC
END
Answer
Right click and select "solve", it will display the optimal path to reach each city from
the last city (backward recursion). So that the total shortest path from city 1 to city 7 or vice
versa is 21. Here are the results of calculations carried out by lingo
150
151
CHAPTER XIV
GAME THEORY
Learning Objectives Chapter XIV is expected that students are able to:
1. Understand the concepts and characteristics of basic game theory (Two-person zero-sum
game, maximin and minimax principles, use of saddle points and non-saddle points, and
domination principles).
2. Formulate a Game Theory case using the Pay-off matrix and solve it.
3. Solving N×M problems using sub-game and graphics methods
4. Understand concepts and solve game theory problems n-person zero-sum game
Game theory can be distinguished based on the number of players and the total value
of gain and loss. In this module, we will discuss the case of Two-person zero-sum game
(TPZSG). The TPZSG case is a case where there are 2 players whose losses and profits add up
to 0. An example of the TPZSG case is chess. Another example is when two advertising
companies want to compete for a larger market.
Basically, game theory can be solved by linear programming. Game theory has a
strong relationship with linear programming, in the sense that a two-person zero-sum game
can be expressed as a linear program, and vice versa. Examples are as follows.
The linear is
Linear Equation of Player A
Maximum z = v
Subject to.
v – 3x1 + 2x2 + 5x3 0
v + x1 + 4x2 + 6x3 0
v + 3x1 + x2 - 2x3 0
x1 + x2 + x3 = 1
x1, x2, x3 0
v unrestricted
152
Linear Equation of Player B
Maximum z = v
Subject to.
v – 3y1 + y2 – 3y3 0
v + 2y1 – 4y2 + y3 0
v + 5y1 + 6y2 – 2y3 0
y1 + y2 + y3 = 1
y1, y2, y3 0
If solved, then the two equations will produce the same value of v. The reason is that
problem B is the dual of problem A (the principle of duality). This means that the optimal
solution of one problem automatically results in the optimal solution of another.
14.2 Game Theory Formulation Using Pay-off Matrix with Saddle points
In game theory there are two types of strategy, namely pure strategy and mixed
strategy. Pure strategy can be used to solve game theory cases that have the same saddle point.
The trick is to use the maximin concept for row players and the minimum concept for column
players. Meanwhile, a mixed strategy is carried out if the pure strategy has not provided an
optimal solution or no saddle point is found. The trick is to use a mix of different strategi es.
To create a problem, we can use the Pay-off matrix. For example, there are companies A and
B that want to dominate the market. There are 2 strategies (I and II) used by these two
companies. If the strategies of the two companies are the same, then company A will get 2
benefits, whereas if the strategies chosen are different, then company B will get 2 benefits. So,
if made into a Pay-off matrix, it will be:
In the pay-off matrix above, it can be seen that a negative value means that company A
will experience a loss and company B will benefit. In the Pay-off matrix, the winner is the
player who maximizes the minimum profit, while the loser is the party who wants to minimize
the maximum loss. If the results are found immediately, then the value is called a saddle point.
For example:
In the matrix above, player A looks for the maximum value from the minimum row
obtained, while player B looks for the minimum value from the maximum column obtained. It
can be seen that the point is worth 4. So it can be concluded that player A will get 4 while
player B will lose 4.
153
As another example, let's look at the problem below.
In a game, player A has 3 choices, namely L, M, and N. While B has 2 possible choices, namely
P and Q. The values of both are:
What is the best strategy for these two players? And how much is it worth?
Setelah kita buat menjadi matriks, maka dapat dilihat seperti diatas, dengan menghitung
maximin dan minimax, maka diketahui nilai saddle point-nya adalah +2, artinya player A akan
mendapatkan keuntungan sebesar 2 dan player B akan mengalami kerugian sebesar 2, dengan
strategi optimalnya yaitu A(0,0,1) dan B(1,0).
In the matrix above, it can be seen that there are no saddle points, so it is necessary to
eliminate options through dominance. If seen, according to the perspective of player B, then
strategy I is not profitable compared to strategy II, this is because strategy I is not profitable
while strategy II is profitable, then strategy I can be eliminated. Thus becoming:
154
Then, it can be seen in strategies III and IV, that B does not get an advantage in strategy
IV compared to strategy III, so IV can be eliminated.
In general, it can be seen that the general rules of domination technique are:
1. If all the elements of a column are greater than or equal to the elements in another
column, the larger column can be omitted.
2. If all the elements of a row are less than or equal to the elements in another row, the
smaller row can be omitted.
155
The mean value is 0.
If you look for the maximin and the minimax, you get:
Because there is no saddle point, reduction is done through dominance. Since the value of
strategy III over B results in the loss of the other strategy, it is omitted, becoming:
156
Due to the absence of saddle points, player A's option III which generates the least profit can
be eliminated, becoming:
Because the saddle point has not been obtained, the formula used to find it is:
14.5 Complete the 2-Person Zero-Sum Game Using the Oddments Method
In addition to using the algebraic method, solving a game theory case without a saddle
point can also use odds and opportunities. Examples are as follows:
The odds of A are calculated by multiplying the value of the diagonal while the odds
are obtained by dividing the value of the oddment by the total value of the oddment player.
Then to get the value of the possibility of winning from a player, then the opportunity value is
multiplied by the oblique value multiplied by the element value and then added.
157
14.6 M×N . Case Solution
In some game theory cases, it is possible that one of the 2 players in a game
theory has a large number of decision choices, but the opponent only has two choices. This
case is called the M x N case. There are two ways to solve this problem. The first is to reduce
it to 2 × 3 or 3 × 2 then solve it using the sub-game method, and the second is to make it 2 × 2
and solve it by the graphic method. The following is an example of solving an M × N case
using the sub-game method.
In solving the case above, no saddle points were obtained, so using the sub-game
method, the problem was broken down into 2x2 with all options getting the same turn to be
compared to the others, thus getting a sub game, namely:
Sub-game I:
Sub-game II:
158
Sub-game III:
In this third sub-game, it is known that the saddle point is at the point (1,3) with a value
of -1. When viewed from the middle value, it can be seen that for player B, the most profitable
value is sub-game II. So it is necessary to look for opportunities to get results according to sub-
game II by:
Another method that can be done to solve 2 x N or M x 2 cases is to use the graphical
method because there is no need to create many sub-games. In this method, graphics are used
to select the most suitable option for both companies. The steps taken in the search for a
graphical solution can be summarized as follows:
1. Find the game odds of A and B in each strategy by using the first chance is X and the
second chance is X-1, then represented by P.
2. The equation that has been formed is then converted into the equation y=mx+c. so that a
straight line can be drawn from the equation in the graphic.
3. Change the x values to 0 and 1 in the Pay-off equation to draw a line on the graph and
determine the Pay-off line.
4. The pay-off line formed at the top will represent player B and the bottom line will represent
player A. The line that becomes the line for the Pay-off line is the chosen strategy. Then
the value can be calculated.
159
From the above case where the saddle point is not obtained, an equation is made based on the
strategy that can be chosen based on the opportunities as in step 1:
After that, proceed to make it into an equation and then determine the x values 0 and 1
Based on the line formed at the bottom, it can be seen that the highest point of the line at point
Q is at P1 and P2, so the strategy chosen is:
160
possible coalition pair. For example, for players A, B, C, and D the following coalitions could
be formed:
A against B, C, D;
B against A, C, D;
C against A, B, D;
D against A, B, C;
A, B against C, D;
A, C against B, D;
A, D against B, C.
If the value of the game for coalition B, C, D is V, then the value of the game for A is
– V, because this is a game with zeros. Thus in a four-person zero-sum game there will be
seven values or game characteristics obtained from seven different coalitions. Let's consider
the following example questions.
Problems example.
Find the value of a three-person zero-sum game in which player A has two choices,
X1 and X2; Player B has two choices, Y1, and Y2 and player C has two choices, Z1 and Z2.
The Pay-off table is as shown below:
Settlement.
There are three possible coalitions, namely:
(1) A against B and C; (2) B against A and C;(3) C against A and B.
Here is the result of the description.
1. A versus B and C
161
The game has a saddle point. Therefore, the best strategy of A is X1 and the best
combination of B and C is Y1 Z2. The value of the game for A = 0, and the values of B and C
are also equal to zero.
2. B against A and C
The game has no saddle point. The first and third columns dominate the second and
fourth columns respectively so that the dominated columns are cancelled. The reduced matrix
is:
By solving the odds method, B's best strategy is Y1 with probability 1/4 and choice
Y2 with probability 3/4. Now A and C must play X1 and Z1 with probability 1/4 and X2 and
Z1 with probability 3/4.
Value of game for B = [(2/4) – (3/4)] / [(1/4) + (3/4)] = - (1/4)
Value of game for A and C is (1/4)
3. C versus A and B
The game has no saddle point. The first column dominates the third and fourth
columns. Then the reduced matrix is:
162
C's best strategy is to play (Z1, Z2) = [(2/8), (6/8)]
For A and B = (X1 Y1, X1 Y2) = [(5 / 8), (3 / 8) ]
Value of game for C = [–(10 / 8) + (12 / 8)] / [(5 / 8) + (3 / 8)] = (2 / 8) / 1 = (1 / 4)
The value of the game for A and B is – (1/4) because it is a zero-sum game.
Therefore, the characteristics of the game are: V(A) = 0, V(B) = – (1/4), V(C) = (1/4) and
V(B, C) = 0, V( A, C) = (1 / 4). V(A, B) = – (1/4)
163
Figure 14.2 Player A Pay-off Matrix in Python
The next step is to create a Pay-off table. The Pay-off table is a bi-matrix containing
the payoff matrices A and B written simultaneously.
164
Figure 14.4 Bi-matrix Pay-off players A and B in Python
In this code there is the Normal Form Game code (also in the output). The Prisoner's
Dilemma represents the normal form play. This is because the game “Prisoners' Dilemma”
consists of the following three conditions:
1. A set of players (A and B)
2. A set of strategies for each player (dove, hawk)
3. For each player, they have a preference over a set of strategy profiles
It should be noted that strategy, and strategy profile are not the same. A strategy profile
is a list containing one strategy for each player. Think rock, paper, scissors games. The strategy
profiles are: (rock, rock), (paper, rock), (scissors, rock), etc. The strategy profile for this game
is as follows: {(dove, dove), (dove, hawk), (hawk, dove), (hawk, hawk)}
Once we understand the strategy and its results, we can write a function to further crystallize
our understanding:
How can the players in the game maximize their preferences? It looks like A and B
both benefit from keeping their lips closed. However, every player is faced with the same
rewards and strategies. Remember, this game is played simultaneously. Each player maximizes
their results by playing hawk (that's the only possible way the player doesn't get locked up).
So, if players are rational and want to maximize their preferences, they will always play hawk.
In slanted economic talk, the hawks dominate the dove. Therefore, the result of our game is
(hawk, hawk). This represents the Nash Equilibrium:
165
14.8.2 Applying Game Theory Concepts to Lingo
In what is called two-person game theory, the main feature is that each of the two
players must make important decisions that ignore those of the other players. Only after both
players have committed to their respective decisions does each player know the other player's
decision and each player receives a reward that depends only on the two decisions. Two-person
game theory is further classified according to whether the payoff is a constant sum or a variable
sum. In a constant number game, the total sum of the results for both players is constant.
Usually this constant is assumed to be zero, so one player's gain is exactly the same as another
player's loss. The following example illustrates a constant sum game (often called a zero sum
game).
A game will be played between two players called Blue and Gold. This is a single
simultaneous movement game. Each player must make one move without knowing the moves
of the other players. Both moves are then revealed and then one player pays the other the
amount determined by the Pay-off table below:
Blue must choose one of two moves, (a) or (b), while Gold has a choice between three
moves, (a), (b), or (c). For example, if Gold chooses move (b) and Blue chooses move (a), then
Gold pays Blue 5 million dollars. If Gold chooses (c) and Blue chooses (a), then Blue pays
Gold 3 million dollars.
Minimax strategy
This game does not have a clear strategy for both players. If Gold is tempted to move
(b) in hopes of winning the 8 million dollar prize, then Blue will also be tempted to move (a),
to win 5 million from Gold. For this example, obviously every player wants to consider a
random strategy. Any player who follows a pure strategy of always making the same moves
will be easily defeated. Therefore, specify:
BMi = probability Blue moves i, i = a or b
GMi = probability of Gold moving i, i = a, b, or c
How should Blue choose the BMi probability? Blue might observe that:
If Gold chooses step (a), the expected losses are:
4 BMA - 6 BMB.
If Gold chooses step (b), the expected losses are:
-5 BMA + 8 BMB.
So, there are three possible losses that are expected depending on the decision made by
Gold. If Blue is conservative, a reasonable criterion is to choose BMi, to minimize the
maximum expected loss. This philosophy is called the minimax strategy. In other words, Blue
wants to choose the probability of BMi, so, no matter what Gold does, the maximum loss that
Blue can expect is minimized. If LB is the maximum expected loss for Blue, the problem can
be expressed as LP:
(Lingo files can be downloaded at: http://ipb.link/material-responsi-po)
166
Figure 14.7 Linear equation of maximizing loss for Blue (LB)
With solution:
The interpretation is, if Blue chooses move (a) with probability 0.6 and move (b) with
probability 0.4, then Blue's expected loss is never greater than 0.2, regardless of Gold's move.
If Gold follows the same argument, but formulates the argument in terms of maximizing
the minimum expected profit, PG, instead of minimizing the maximum loss, then Gold's
problem is:
With solution:
167
The interpretation is, if Gold chooses to move (b) with probability 0.35, move (c) with
probability 0.65 and never move (a), then Gold's expected profit is never less than 0.2. Note
that Gold's lowest profit expectation is the same as Blue's highest expected loss. From Blue's
point of view, the expected transfer to Gold is at least 0.2. The only possible transfer expected
is 0.2. This means that if both players follow the random strategy that was just revealed, then
each game is expected to transfer 0.2 units from Blue to Gold. This game favors Gold at a rate
of 0.2 million dollars per game. The strategy of choosing randomly among alternatives to keep
the opponent guessing, is also sometimes known as a mixed strategy.
On closer inspection, in the solutions for LP Blue and LP Gold, there are surprising
similarities. The double price of LP Blue is equal to the probability of LP Gold and the double
negative price of Gold is equal to the probability of LP Blue.
168
BIBLIOGRAPHY
[1] F. S. Hillier dan L. J. Gerald, Introduction to Operation Research, New York: McGraw-
Hill Education, 2015.
[3] LINDO, LINGO The Modelling Language and Optimizer, Chicago: Lindo System Inc,
2018.
[7] R. P. Murthy, Operation Research, Anantapur: New Age International Publisher, 2007.
[10] S. Anwar, T. Djatna, Sukardi dan S. P, “Modelling supply chain risks and their impacts
on the performance of the sago starch agro-industry,” International Journal of
Productivity and Performance Management, 2021.
[11] T. Djatna dan Sarinah, “Analisis strategi penanganan risiko kekurangan pasokan pada
industri pengolahan rumput laut: kasus di Sulawesi Selatan,” Agritech, vol. 35, no. 2,
2015.
[13] T. Djatna, S. Nasution, Y. Arkeman dan K. Soewardi, “Identifikasi dan evaluasi risiko
menggunakan Fuzzy FMEA pada rantai pasok agroindustri udang,” Journal of Industrial
Research, vol. 8, no. 2, pp. 135-146, 2014.
[14] T. Djatna dan E. S. Novina, “The classification tehnique in distribution and transportating
planning,” 2013.
169
170