Download as pdf or txt
Download as pdf or txt
You are on page 1of 177

Handbook of Lecture and Response

Operational Research

Prof. Dr-Eng. Taufik Djatna, STP, MSi


& Assistance Team 2022

Agro-Industrial Technology Press


IPB University

2022
FOREWORD

Introduction and Purpose

Operations Research is a core discipline in modern industrial management from both an


operations perspective and a short and long term strategy. The OR discipline stems from the
motivation for solving military problems on the front lines, initially during World War II. OR
makes an important contribution to logistics, supply chain and strategic simulation of
battlefield competition. In the current era of the industrial revolution 4.0, OR is the mainstay
of superior decision-making for each industry player. Since its early days OR's development
has incorporated analytical capabilities in a very wide range of industrial applications,
including artificial intelligence, cybersecurity, and big data, and is the cornerstone of
management science in manufacturing, marketing, telecommunications, and many other fields.
OR brings analytical capabilities to a more effective solution level through research, practical
applications, case studies and lessons learned in the field. Today the application of OR is no
longer limited to traditional optimization problems, formulation capabilities in analytical
studies but also supports solutions for dynamic problem spaces that have applications for cyber,
policy, and industrial operation performance evaluation. Therefore, there is a critical need for
students, faculty, practitioners, industry players and industrial systems analysts to understand
the problem space, best practices, and lessons learned from real-life problems. The contextual
environment discussed in OR is key to understanding and developing cutting-edge analysis that
transforms and advances the application of traditional OR research and analysis and the
challenges of emerging methods. The aim of this book is to provide a set of approaches, case
studies, reading material, and response guides to illustrate the application of OR and analytical
techniques in the broad industrial, business and agricultural sectors. The content can be used
by educators to facilitate and enhance understanding in class discussions as well as by
practitioners for guidance on best practice in real-world fields. Book Organization To achieve
this goal, we have compiled this book into a discussion of quantitative and algorithmic
formulations and approaches to build soft skills and the ability to formulate, apply, and use OR
solutions generated perspectives. We present approaches that range from general to specialized
in OR and provide detailed guidance on using traditional OR and analytical techniques to
industrial and business problem spaces using mainstream software, such as Microsoft Excel,
POM-QM, Python, Lingo and LiPS to develop analytics., applying analytical methods and data
science. At the same time it also makes use of utility theory and decision analysis, planning

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.

What Does This Handbook Provide?

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

Taufik Djatna, Prof.Dr-Eng.

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.1 Definition and Basic Concepts of Operations Research


Operations Research (PO) or Operations Research (RO) is a problem-solving technique
by finding optimal solutions using various mathematical methods and approaches that were
first developed in World War II. Initially, operations research techniques and methods were
used to win the war by arranging logistics and other allocations in a very wide war area. After
the war was over, this method was then adopted in industry and business to produce optimal
solutions in the allocation of production resources in order to reduce production costs,
maximize profits, and other problems.
Operations research is applied to various problem areas because operations research
techniques and methods can produce optimal solutions. In operations research, analysts are
required to be able to choose optimal solutions to problems that have been supported by clear
assumptions. Therefore, operations research aims to provide decision makers with a scientific
basis for solving a problem with the interaction between its components, with the help of a
team from various different backgrounds who work together to find the right solution according
to the wishes of the whole organization.
Operations Research is the study of how to form mathematical models of complex
engineering and management problems and how to analyse them to gain insight into possible
solutions. A mathematical model is a collection of variables and relationships needed to
describe the related features of the problem (Radit 2015).

1.2 Operations Research Characteristics


Operations research has special characteristics, namely:
• Using a cross-scientific approach.
The problems of various operations research make a team of analysts who focus on using
operations research techniques need to collaborate with experts from other fields, especially
those from the problem area. This is to be able to have a completer and more comprehensive
picture of the problem, so as to avoid choosing the wrong decision. The three fundamental
concerns in shaping the operations research model are (a) decisions are open to decision
makers, (b) constraints limit decision choices, and (c) the goal of making some decisions more
favourable to others (Radit 2015).

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).

Objective function (Objective function)


The objective function represents the objective = objective of the problem on the decision
variable. Maximizing or minimizing function is a goal that must be achieved by decision
makers, can maximize total profit or minimize total production costs during production
activities or sales of certain products. The parameter used for the decision variable in the
objective function is the value of profit (maximization) or cost (minimization) per unit of
product. The parameter of this objective function is also known as the coefficient (profit or
cost).

• Increase creativity of decision makers.


Operations research provides decision makers with a variety of mathematical models and
solutions. This model gives decision makers the ability to understand the problems they face
better and can choose the most optimal decisions compared to just guessing using reason.

• Using a systems approach.


An institution in general is a system that has many sub-systems in it. Thus, decisions made
in one sub-system will affect other sub-systems. In the operations research approach, analysts
are required to understand and incorporate the relations, variables and characteristics of all
these subsystems in order to produce optimal solutions. So that operations research can be
categorized using a systems approach.

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.

3. Determination of Resources and Limits


Resources are limited things that are used and affect the determination of the value of
the variable. In the above case, the resources used are machines A, B, C, D, and E with limited
production capacity in hours. Products X and Y require processing time on each machine. The
production capacity in this unit of time is the limitation of the problem in the example above.

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.

7. Application of selected solutions and their Maintenance


After the values of X and Y are known, a decision will be made based on these values
and used until there is a change in the model or other conditions.

1.4 The Role of Operations Research


Operations research is used in many fields to solve specific problems related to the field.
Some examples of the application of operations research are:
• Defense Operation
Operations research was intensively used and developed in World War II. At this time, many
models were successfully developed such as transportation models, allocation models and
others. In warfare, techniques such as linear programming, game theory and the
aforementioned models are used to determine troop delivery and logistics such as
ammunition and war machines. These techniques are used to determine the right decisions
in order to win the battle.
• Industry
The use of operations research in industry focuses on lowering production costs, increasing
productivity, more appropriate use of resources, and planning for healthier corporate
growth. Operations research techniques used by managers in industry are decision trees,
inventory models, linear programming models, transportation models, sequencing models,
assignments and replacements. models.
• Economic Growth Planning
Economic growth that has been designed by the state needs to be supported by an adequate
and appropriate allocation of resources. However, a country's resources, both human and
other resources, are limited. So that the allocation of these resources is generally completed
with the help of operations research so that it can be distributed in each field effectively.
• Agriculture
The limited amount of agricultural land becomes a challenge for a country to be able to use
it to meet the needs of its people. Therefore, the processing and management of agricultural
land through the distribution of agricultural activity needs and the use and selection of land
for planting agricultural commodities requires appropriate operations research techniques to
produce optimal output.

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

2.1 Definition of Linear Program


A linear program is a model with a method that describes an optimization problem into
linear inequalities. The application of linear programming is relatively broad, covering all
problems involving the use of limited resources. The application of linear programming is
intended to find the optimal solution for those resources. Before evaluating a case of linear
programming, we need to be able to formulate statement sentences or data tables into the form
of a mathematical model. After that, the model needs to be formulated in graphical form so that
it is easier to see the optimal point of the problem.

2.2 Mathematical Formulation in Linear Programs


In the application of linear programming, a problem is formulated mathematically into
linear inequality functions, in which there are three main components, namely decision
variables (unknown model), objective function (which needs to be optimized), and constraints
(limitation or limitations of the model).
• Decision Variables
The decision variable depends on the type of problem to be considered. For
instance, the form of a decision variable can be the number of resources to be allocated,
the number of units to be produced, or both. Decision variables are generally denoted
by x1, x2, . . . or x, y, and z. However, symbolization can also be done freely as desired.
Although some software products limit the variable length of the name, others allow
the length of alphabetic or alphanumeric characters. In some cases, 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.
• Objective Function
The objective function represents the objective = objective of the problem on
the decision variable. Maximizing or minimizing function is a goal that must be
achieved by decision makers, can maximize total profit or minimize total production
costs during production activities or sales of certain products. The parameter used for
the decision variable in the objective function is the value of profit (maximization) or
cost (minimization) per unit of product. The parameters of this objective function are
also known as coefficients (profit or cost).
• Constraint Function
Constraints can also be called constraints 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.

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:

Figure 2.1 Graphical formulation of the mathematical model

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.

Calculate the amount of profit:


F(x) = 75.000(10) + 60.000(5) = Rp1.050.000

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.

2.4 Solving Linear Program Based Modelling with Excel Solver


In an optimization framework with a linear program, you can use the Solver facility
found in Excel. To use it, you can follow these steps:
1. Click the File menu in Excel, then select Options
2. In the Options dialog box, select Add-ins, select Solver Add-ins

9
Figure 2.2 Solver add-in

3. Select Solver Add-in, then click Go


4. A new dialog box will appear, then select it by checking the Solver Add-in, then click
Ok
5. Solver will appear on the Data Tab => Group Analyse and ready to use.

Figure 2.3 Excel solver

To explain the stages of working on linear operations research programming problems


with Excel Solver, we follow the following example questions:
Product Mix Case
Case: Samsang Company is an electronics company with productions such as television, stereo
and speakers. The company always needs components such as chassis, picture tube, speaker
cone, power supply and electronic equipment. These components have a limited supply,
namely 425 units of chassis, 250 units of picture tube, 700 units of speaker cones, 450 units of
power supply and 650 packages of electronic equipment. With limited inventory as a
production manager is asked to determine the combination of products with maximum profit.
Note that to produce 1 unit of television product, the components needed are the chassis (1
unit), picture tube (1), speaker cone (2), power supply (1), electronic device (2); 1 unit of stereo
is required chassis components (1 unit), speaker cone (2), power supply (1), electronic device
(1) and 1 speaker unit requires two components, namely speakers (1 unit) and electronic device
(1). The profit for each unit of product is 175,000 televisions, 75,000 stereos and 50,000
speakers.

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

Figure 2.4 Problem solving in 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).

4. After all data is entered, click solver

Figure 2.5 Display of solver parameters

• 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.

Figure 2.6 Display of add constraint

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:

Figure 2.7 Display of solver option

• 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.

Figure 2.8 Display of solver result

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

3.1. Simplex Method


We can solve LP (Linear Programming) problems using the graphical method when there
are only two decision variables. However, most of the existing LP cases or problems have
models with three or more variables. The simplex method is a way of solving problems that
have at least two decision variables using the help of a table. The simplex method is used to
achieve the goal of maximizing profit or minimizing costs. Here is the sequence of steps in the
simplex method:
1. Changing the objective function
Objective function:
Z = S CjXj
Z = C1X1 + C2X2 + … + CnXn🡪 Z – C1X1 – C2X2 – … – CnXn = 0
2. Changing the constraint function
Change the constraint function and add a slack variable (S) to each constraint. Slack
variable or dummy is an additional variable that represents idle capacity.
Constraint function:
A11X1 + A12X2 ≤ B1 🡪 A11X1 + A12X2 + S1 = B1
A21X1 + A22X2 ≤ B2 🡪 A21X1 + A22X2 + S2 = B2
A31X1 + A32X2 ≤ B3 🡪 A31X1 + A32X2 + S3 = B3
Where: AijXj ≥ 0
3. Entering coefficients from the objective function, constraint function, and right-hand-side
value into the simplex table.
Coefficients are numbers/values attached to each variable. In this case, variables X, A or
S. The right-hand-side value (RHS) is the value on the right side of the equal sign (=).

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

4. Defining Key Column (KC)


Key column is selected from the smallest negative value in row Z.
For example: C1 = -10, C2 = -4, then KC is in column X 1
5. Defining Key Row (KR)
Key row is determined by the row with the smallest index value > 0.
Value of index = Right-Hand-Side Value Coefficient Key Column Coefficient

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

6. Determining Key Element (KE)


Key element is the number in the intersection of KC and KR. In this case, KE is in A21.

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

7. Creating a New Key Row (NKR)


The steps to create NKR is as follows:
a. Arrange a new table
b. The KC base variable is transferred to the KR base variable.
c. Fill in the row that has been determined as KR in the first table above by dividing the
coefficient of KR by KE. The value is denoted by k, l, m, n, o, p, where k = A12/A21, l =
A22/A21, m = 0/A21, n = 1/A21, o = 0/A21, p = NK/A21

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

8. Changing the value other than the value in KR.


New rows are rows in the new table that have not been filled. Fill in the new line using
the following formula:

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)
… … … … … …

The calculation results of points a, b, c are entered into Table 5.

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.

3.2. Application of the Simplex Maximization Method


A convection company has the following objective and constraint functions:
Z = 750X1 + 500X2
2,5X1 + 2X2 ≤ 100 -> fabric
X1 + 6X2 ≤ 50 -> labor
3X1 ≤ 75 -> machine

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

Index Z = 0-750= 0 Index S2 = 501= 50


Index S1= 1002,5= 40 Index S3 = 753= 25
Hence, the Key Row is S3
6. Key Element

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

Table 3.10 Determining New Key Row

k = 3/3 = 1; l = 0/3 = 0; m = 0/3 = 0; n = 0/3 = 0; o = 1/3 = 0,3333; p = 75/3 = 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

k= 0/3 = 0; l = 6/6 = 1; m = 0/6 = 0; n = 1/6 = 0.667; o = -0.333/6 = -0.0555; p = 25/6


= 4.1667

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

In table 3.14, the value of Z ≥ 0, then the table is optimal.


Proof:
Z = 750X1 + 500X2 🡪 = 750(25) + 500(4.1667) = 20833

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

2. Goal minimization method


a. Key Column is selected with the smallest negative value
b. Optimal table condition is that the values of row Z ≥ 0
c. The calculation results are as follows:
BV X1 X2 A1 S1 A2 S2 RHS
Z -3 -4.5 0 1 0 1 0
A1 2 1.5 1 -1 0 0 150
A2 1 3 0 0 1 -1 200
Z -1.5 0 0 1 1.5 -0.5 6000
A1 1.5 0 1 -1 -0.5 0.5 75
X2 0.333 1 0 0 0.3333 -0.333 125

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

4.1 Definition of Duality and Sensitivity Analysis


Systematically, Duality is one of the tools for solving linear programming problems, which
are directly defined from the original problem (Primal linear programming model). In the
majority of linear programming treatments, duality devices are highly dependent on primal in
three things, namely; types of constraints, decision variables and optimum conditions. Because
of the things mentioned above, the duality theory in reality is not strictly required to be used.
Duality and Sensitivity Analysis are widely used in:
1. Duality can be used more broadly for checking or testing the truth and valid results of
the initial values obtained by the simplex method as the basis for management in
making the best decisions.
2. Next, Sensitivity Analysis is also used to test or check. Sensitivity analysis is used first
to prevent repetition of the calculation of the starting point, if there are various forms
of changes to the Linear Programming Simplex problem. The changes referred to above
include:
a. Changes that occur in the value of the coefficient that is in the objective function.
For example, in the previous case, if there is a change in the company's financial
condition and market structure, the profit target of rubber-based shoes has changed
from Rp. 300,000 per unit to Rp. 500,000 per unit, and so on.
b. Increase the maximum capacity of production machines/work equipment installed.
This happens because of the scheduled maintenance process of the machine,
including: oil changes, and resetting. So that the duration of the machine's
operation, which was previously only 15 hours, can now be operated with a duration
of up to 16 hours. The change that occurs is an increase in the performance of the
duration of the operation.

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.

4.2 Example of Duality Operation


The first step to understanding the concept of Duality is the need to understand the basic
concept that duality is the 'opposite' of the Simplex problem. In fact, Simplex is also termed
the Primal problem. Thus, the Dual problem is often called the 'opposite' of the Primal problem
(or the simplex problem).

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:

Machine X1 X2 Max capacity

A 2 0 8

B 0 3 15

C 6 5 30

the role of the


machine on the profit
3 5
per dozen (in IDR
100,000,-)
Table 4.1 Case simplification

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

Table 4.2 Dual case

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

Table 4.3 Results

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:

notice that the sign also


2Y1 + 6Y3 ≥ 3 changes
3Y2 + 5Y3 ≥ 5
Y1, Y2, dan Y3 ≥ 0
Take note!
There are several things to note regarding the objective function and dual constraints above:
1) Changes in the objective function. The maximizing objective function changes to the
minimization objective
2) The coefficient value of the objective function (ie: 8, 15, and 30). The 3 values were
previously the right value (NK) resulting from the primal constraint function (Simplex).
3) The right value (NK) of the dual constraint (ie: 3 and 5), this value was previously the value
of the objective function coefficient of the Primal case (Simplex)
4) In the dual constraint, the coefficient value is the result of the vertical 'reading' of the
coefficient value in the primal (Simplex) constraint
5) The number of constraints (ie: 3) the primal (simplex) in the dual function will turn into the
number of variables (Y1, Y2 and Y3)

27
Furthermore, if the two Primal and Dual problems above are juxtaposed, it will look as follows:

Primal objective function: Dual Purpose Function :

Maximize Z = 3X1 + 5X2 Minimize Y = 8Y1 + 15Y2 + 30Y3

Constraint: Constraint:

Machine A 2X1 ≤8 2Y1 + 6Y3 ≥ 3


Machine B 3X2 ≤ 15 3Y2 + 5Y3 ≥ 5

Machine C 6X1 + 5X2 ≤ 30


Y1, Y2, dan Y3 ≥ 0
X1, X2 ≥ 0

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

Z 0 0 0 5/6 1/2 27,5


X3 0 0 1 5/9 -1/3 6 1/3
X2 0 1 0 1/3 0 5
X1 1 0 0 - 5/18 1/6 5/6
Table 4.4 Optimal results of simplex

Based on the Simplex optimal table, it can be seen that:


1. The production quantity for rubber shoes (X1), is 5/6 (NK column in X1 row). Meanwhile,
for shoes made of leather, it is produced in a quantity of 5 (NK column in line X2)
2. The level of profit earned by the company based on the results in point one is 27.5 or
2,750,000 (NK column in row Z)

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.

4.3 Sensitivity Analysis


Sensitivity analysis is an analysis used to determine the implications of changes that
occur to various parameters of the linear programming model, to the optimal solution that has
been achieved previously. In other words, that this approach is used to analyze the emergence
of changes in the coefficients in the linear programming model and the various consequences
that may be caused. This analysis is carried out after the optimal conditions have been
determined from the calculations. Because of this, this analysis is often referred to as Post
Optimality Analysis.

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

According to the previous description, sensitivity analysis can be used in addition to


testing the correctness of the Primal (Simplex) optimal result, it can also be used to prevent
repetition of the initial calculation if there is a change in the Primal (Simplex) LP problem. The
implementation of testing on the Primal (Simplex) optimal results is carried out by using
several values in the optimal Simplex table (specifically for values that are below the base
variable), except for those that are in the goal line (Z). Let's look again at the previously defined
Simplex optimal table:

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:

NK Before Change NK Before Change


[8 15 30] [8 16 30]

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?

Let's check together, by doing the calculations below:


[1 5/9 -1/3 0 1/3 0 0 -5/18 1/6 ] * [8 1 30] = [48/9 15/3 5/9]

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:

[0 6 4] * [1 5/9 -1/3 0 1/3 0 0 -5/18 1/6] = [0 8/9 2/3]

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)

5.1 Revised Simplex Method


The revised simplex method is a method of linear programming (LP) that uses a matrix
form in the process so as to shorten the calculation time and simplify the calculation of the
ordinary simplex method. This method has a basic concept, if LP is assumed to have a basic
feasible solution, then by assigning a zero value to the non-line variable, the row value and
objective function can be obtained. The general LP problem can be written:

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:

Reduced cost of xj, calculated as

The notation Vi represents the element i in the vector V.


Optimal Condition. The z-equation shows that in the maximization case, a nonbasic
increase in xj above the current zero value can increase the z value (relative current value,
CBB-1b) only if zj - cj < 0. For minimization, the condition zj - cj > 0. So, the entering vector
is selected as a nonbasic vector with zj - cj being the most negative (maximizing) or the most
positive (minimizing).
Feasible Condition. It is known that the entering vector Pj under optimal conditions, the
constraint equation reduces

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

If zj - cj > 0 in maximization or zj - cj < 0 in minimization for all nonbasic vectors,


then stop, the optimal solution is XB = B-1b, z = CBXB.
If not, determine the incoming vector Pj which has the most negative zj - cj for
the maximization case and the most positive for the minimization case among
all nonbasic vectors.
Step 3. Calculate B-1 Pj. If all elements of B-1 Pj are negative or zero, then stop, the
solution is infinite. Use the ratio test to determine Pi's leaving vector.
Step 4. Form the next base by replacing the outgoing vector Pi with the incoming vector
Pj on the basis B. Return to step 1 for a new iteration.

5.3 Application of the Revised Simplex Method by Reddy Milks Company


Reddy Mikks company produces two types of paint, namely interior and exterior paint
using two types of raw materials from two raw materials, M1 and M2.

The following table provides the basic data of the problem:

Table 5.1 Problem data

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:

So, P1 is the entry vector.

36
Feasibility calculation:

Therefore,

and P3 becomes the leaving vector.


The above results can be summarized in a simple simplex table:

Table 5.2 Simple simplex

Iteration 1

By the inversion method, we get

So,

Optimality calculation:

P2 is entering vector.

37
Feasibility calculation:

Therefore,

P4 is leaving vector.

So

(It will be easier if it is summarized like a simplex table at iteration 0).


Iteration 2

inverted to

So,

Optimality calculation:

X B is optimal because zj – cj > 0, then the iteration stops.

38
So, it can be concluded that the optimal solution in this case is:

5.4 Interior Point Algorithm


Interior point algorithm is a linear program solving method with the aim of optimizing
the objective function 𝑍 = 𝑐 𝑇𝑥 based on the constraints 𝐴𝑥 = 𝑏 and 𝑥 ≥ 0 (Karmarkar 1984).
This algorithm has a large number of constraint functions and decision variables so it is
very effective for solving complex problems. The interior point value is done randomly
with a note that the value given must meet the constraints of the problem. If the interior
value does not meet the limits, the resulting value cannot reach the optimal solution. The
discovery of the interior points algorithm is able to develop a new algorithm in linear
programming. The step of solving the maximization case in the interior point algorithm
requires the addition of a slack variable. The solution steps using the interior points
algorithm method are:

1. Choose interior point


X = (x1, x2, x3, …, xn)
Where x is the decision variable
The steps for determining the diagonal matrix D are:

2. Determine the new coefficients of the constraint function and the objective function

3. Determine the projection matrix P

39
4. Define projected gradient

5. Determine by iterating the coordinates of the new point

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

6.1 Concepts and Integer Programming


Integer programming is a special form of linear programming, in which some or all of
the variables are constrained to be non-negative integers. This form occurs because not all
decision variables are fractional numbers. For example, if the decision variable is related to
determining the number of machine products that must be produced, the result is 6.5 machines,
then the determination of the machine that must be taken is between 6 machines or 7 machines,
because the result of 6.5 cannot be taken in a real decision. This rounding solution has
drawbacks in terms of meeting the existing constraints. The concept of linear programming,
rounded solutions are not feasible, because the solution model implies the same basis but can
produce two different solutions.

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.

6.2 Integer Programming step application


An illustration of the rounding procedure for the three problems is presented as
follows:

Problem 1:

Maximize :Z= 100 X1 + 90 X2


Subject to 10 X1 + 7X2 ≤ 70
5 X1 + 10X2 ≤ 50
X1 ; X2 ≥ 0
Problem 2:

Maximize :Z = 200 X1 + 400 X2


Subject to 10 X1 + 25X2 ≤ 100
3X1 + 2X2 ≤ 12
X1 ; X2 ≥ 0

43
Problem 3:

Maximize :Z= 200 X1 + 400 X2


Subject to 10 X1 + 25X2 ≤ 100
3X1 + 2X2 ≤ 12
X1 ; X2 ≥ 0

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:

Solusi dengan Dgn pembulatan Bulat optimum


Masalah Metode simpleks terdekat sesungguhnya

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.

6.3 Integer Programming Model

6.3.1 Three Integer Programming Model


a. Pure Integer Programming
An integer programming problem model that has the characteristic that all variables are
integers.

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.

An entrepreneur has $250,000 in excess and plans to invest in 3 types of investments,


namely condominiums, land and bonds. The entrepreneur wants to invest in the hope that at
the end of the year he will get the greatest return. The data for the three types of investment are
as follows:

Investment Price Availability Profit/year


type
Condo $50.000/unit 4 unit $9.000
Soil $12.000/are 15 are $1500
Bond $8.000/Bond 20 Bond $1000
Table 6.3 Examples of mixed integer programming problems

Maximize Z = 9000x1+ 1500x2+ 1000x3


Subject to 50.000 x1 + 12.000x2 + 8.000x3 ≤ 250.000
x1 ≤4
x2 ≤ 15
x3 ≤ 20
x2 ≤0
x1, x3 = 0 or integer

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 ?

The problem formulation for this case study is:


If x1 : Swimming Pool
x2 : Tennis Court
x3 : athletic field
x4 : Sport Centre

Maximize z= 300x1+ 90x2+ 400x3 + 150x4


Subject to 35.000 x1 + 10.000x2 + 25.000x3 + 90.000x4 ≤ 120.000
4x1 + 2x2 + 7x3 + 3x4 ≤ 12
x1 + x2 ≤1
x1, x2 x3, x4 = 0 or 1

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.

b. Branch and Bound Method

The optimal solution method for a linear program that produces a number decision variable in
the form of an integer.

Branch and bound method completion steps:

1. Solve linear programming problems using ordinary simplex steps


2. Research the optimum solution. The spherical optimum solution has been obtained if the
desired basis variable is spherical
3. Determine the value of the broken solution that is feasible to be branched into sub-problems,
with the aim of eliminating continuous solutions that do not meet the unanimous solution.
4. For each sub-problem, the upper bound is the value of the continuous optimum solution of
the objective function and the lower bound is the best integer solution. Sub-problems that
have an upper limit less than the lower limit, then this sub-problem is not included in the
next analysis.

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

All software packages featured in your OR Courseware (Excel, LINGO/LINDO, and


MPL/Solver) include algorithms for solving BIP models (pure or mixed), as well as algorithms
for solving general IP models (pure or mixed) in which variables must be integer but not binary.
However, because binary variables are much easier to handle than general integer variables,
the former algorithm can generally solve much larger problems than the latter.
When using Solver (or ASPEn Solver), the procedure is essentially the same as for
linear programming. One difference appears when clicking the "Add" button in the Solver
dialog box to add a constraint. In addition to the constraints that correspond to linear
programming, it is also necessary to add integer constraints. In the case of non-binary integer
variables, this is done in the Add Constraint dialog box by selecting the integer -delimited
variable range on the left hand side and then selecting "int" from the pop-up menu. For binary
variables, select "bin" from the pop-up menu.
One of the Excel files for this chapter shows a complete spreadsheet formulation and
solution illustrating the IP model formulation and its graphical solution, along with the
spreadsheet formulation and solution.
The LINGO model uses the @BINO function to determine that a variable named in
parentheses is a binary variable. For common integer variables (which are restricted to int ger
values but not only binary values), the @GINO function is used in the same way. In either case,
the function can be embedded inside the @FOR statement to impose this two or integer
constraint on the entire set of variables.
In the LINDO syntax model, a binary or integer constraint is inserted after the END
statement. Variable X is set to be a common integer variable by entering GIN X Alternatively,
for any positive integer value of n, the statement GIN n specifies that the first n variables are
common integer variables. Binary variables are handled in the same way except for replacing
the word INTEGER with GIN
For the MPL model, the INTEGER keyword is used to denote common integer
variables, while BINARY is used for binary variables. In the variables section of the MPL

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)

An entrepreneur has an excess of $240,000 and plans to invest in 3 types of investments,


namely condominiums, land and bonds. The entrepreneur wants to make an investment with
the aim of getting the biggest return at the end of the year.

Investment type data:

Investment Price Availability Profit/year


type
Condo $50.000/unit 4 unit $9.000
Soil $12.000/are 15 are $1500
Bond $8.000/Bond 20 Bond $1000
Table 6.5 Examples of mixed linear programming problems

The formulation of this problem is


Maximize Z = 9000x1 + 1500x2 + 1000x3
Subject to 50000x1 + 12000x2 + 8000x3 ≤ 250000
X1 ≤ 4, X2 ≤ 15 ,X3 ≤ 20, X2 ≥ 0, X1, X3 ≥ 0 and integer

51
Figure 6.1 Input data

Figure 6.2 Calculating the LHS . value

Figure 6.3 Display of solver parameters


X2, which is the second alternative (land) can be a non-integer value
Conclusion:
The investment chosen is a condominium of 4 units and a land area of 4.17 acres with an
annual profit of $42,250

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.

Figure 6.4 Decision tree

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

In the cutting-plane algorithm, a set of constraints is added to the assignment problem


to exclude subtour solutions. Determine u j (≥ 0) a continuous variable for the city j = 2,
3, ......, n. The desired additional constraint (cutting-plane) is

Adding this cutting to the model results in a mixed integer linear programming (milp) with
binary xij and continuous uj.

An example of applying Cutting-plane algorithm.

Consider the distance matrix of the following 4 city TSP problem:

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

7.1 Pure Integer Case


● Set-Covering Problem
The problem discussed in this subchapter is that there are overlapping services offered
by a number of installations to a number of facilities. The objective of this problem is to
determine the minimum number of installations that will cover or fulfill the services of each
facility. For instance, water treatment plants can be built in various locations with each
installation serving a specific community. Overlap occurs when more than one installation can
serve a particular community. Notice the example below.

● Security Phone Installation


To promote on-campus safety, the Department of Public Security is in the process of
installing emergency telephones at certain locations. The department wants to install a
minimum number of telephones that service every major street on campus. The main campus
roadmap is shown in the image below. To maximize its usability, the phone is placed at a
crossroads. This way, one unit can serve at least two roads.

fx={1 , telephone is installed at intersection j, j=1,2,…..,8 0, otherwise}

Figure 7.1 Schematic of public telephone locations

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

xj= (0, 1);j = 1, 2,.......,

Solution with Lingo

Figure 7.2 Solution with Lingo

58
Figure 7.3 Solution with Lingo

Solution with Python

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.

● Telephone Provider Selection


Three telephone companies offer to subscribe to their long distance service in the
United States. MaBell will charge a flat fee of $16 per month plus $0.25 per minute. PaBell
will charge $25 a month but will reduce the cost per minute to $0.21. As for BabyBell, the
fixed monthly fee is $18, and the per minute fee is $0.22. I usually make an average of 200
minutes of long distance calls each month. Assuming that I don't pay a fixed monthly fee
unless I make calls and that I can split my calls between the three companies as I please,
how should I use the three companies to minimize my monthly phone bill?

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:

Table 7.1 Expected results of each project


Which project to choose in the 3 year timeframe?
The problem is reduced to a “yes - no” decision for each project. Binary variable x j can be
determined as follows:
xj={1, if project j is selected 0, if project j is not selected
The linear integer programming model becomes:
Max z = 20x1+ 40x2+ 20x3+ 15x4+ 30x5
Constraint function:

The optimum integer solution (obtained via AMPL, Solver, or TORA) is x 1= x2= x3= x4= 1,
x5= 0, where z = 95 ($ million).

7.2 Mix Integer Case


● Either-or and if-then constraints
This section discusses models in which the constraints are neither concurrently (either-
or) or dependent (if later), again using additional binary variables. Transformation using
mathematical tricks is performed to present a special constraint as an and-constraint.
● Job Order Model
Jobco uses one machine to process three jobs. Both the processing time and due date (in
days) for each job are given in the table below. The due date is measured from zero, starting
time is assumed on the first job.

Table 7.2 Due date

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

8.1 Goal Programming Concepts And Problem Solving


In real life, almost all problems have several purposes, not just one. For example, if a
health care company concentrates solely on high-quality health care, the owner's profits may
be reduced. The Goal Programming (GP) model seeks to simultaneously take into account
several goals or objectives of concern to the decision maker. While a linear programming
model consists of a constraint and a single objective function to be maximized or minimized,
an objective programming model consists of a constraint and a set of objectives that are
prioritized in some way. GP is a relevant and simple technique in Operations Research that
helps decision makers in solving problems involving conflicting criteria and objectives. To
understand the GP solution, we must first understand the GP formulation which will be shown
by the following example questions:
Sabang is a small city in the western part of Indonesia with a population of about 20,000
residents. The annual tax base for real estate properties is IDR 550 million. The annual tax base
for food and medicine and for general sales is Rp.35 million and Rp.55 million, respectively.
Annual local gasoline consumption is estimated at IDR 7.5 million gallons. The city council of
Sabang wants to develop a tax rate based on four main objectives:
Tax income must be at least Rp. 16 million to meet the city's financial commitments.
• Food and drug taxes cannot exceed 10% of all taxes collected.
• General sales tax must not exceed 20% of all taxes collected.
• Gasoline tax does not exceed Rp. 2000 per gallon.

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:

550 xp + 35 xf + 55 xs + 0.075 xg ≥ 16 (tax income)


35 xf ≤ 0.1 (550 xp + 35 xf + 55 xs + 0.075 xg) (food and drug tax)
55 xs ≤ 0.2 (550 xp + 35 xf + 55 xs + 0.075 xg) (general sales tax)
xg ≤ 2 (petrol tax)
xp, xf , xs, xg ≥ 0

the modeling is then simplified as:


550 xp + 35 xf + 55 xs + 0.075 xg ≥ 16
55 xp – 31.5 xf + 5.5 xs + 0.0075 xg ≥ 0
110 xp + 7 xf – 44 xs + 0.015 xg ≥ 0
xg ≤ 2
xp, xf , xs, xg ≥ 0

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.

8.2 Mathematic Formulation Goal Programming


There are several types of objective functions in GP, namely :
1. Minimize
Used in a problem where there is no difference in deviation variables based on weights
or priorities.

2. Minimize for k = 1,2,...,K


Used in a problem where a sequence of objectives is required, but the deviation
variables within each priority level have the same importance.

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

8.3 Goal Programming Algorithm


This section presents two algorithms for solving GP. Both methods are based on the
representation of multiple objectives with a single objective function. In the weight method,
the single objective function is the sum of the weights of the function that represents the
objective of the problem. The preemptive method begins by prioritizing goals in order of
importance. The model then optimizes the objectives one by one in order of priority and in a
way that does not degrade the solution with the higher priority. The two proposed methods
generally do not yield the same solution. Neither method, however, is superior to the other, as
the two techniques require different decision-making preferences.

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

Cost (in thousands of dollars)/minute 8 24


Assigned employee/minute 1 2

Table 8.2 Simplification of the problem

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:

Minimize z = 2G1 + G2 = 2 s1- + s2+

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.

GP presents a "special" simplex method which ensures non-degradation of higher


priority solutions. This method uses a column dropping-rule which eliminates the non-basic
variable xi with a non-zero cost reduction (zj – cj 0) from the optimal tableau objective Gk
before solving the objective problem Gk+1. The rule recognizes that these non-basic variables,
if raised above the zero level in a successful goal optimization, can decrease (but never
increase) the quality of the higher-priority goal. Such a procedure requires including the
objective functions of all objectives in a simple tableau model.

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).

• Step 2. The objective function of LP2 is


Minimize G2 = s2+
The constraints are the same as in step 1 plus the additional constraint s1- = 5.
In general, the additional constraint s1- = 5 can also be accounted for by substituting s1- in
the first constraint. The result is that the right side of the exposure target constraint will be
changed from 45 to 40, so the constraint function becomes:
4x1 + 8x2 - s1+ = 40
8x1 + 24x2 + s2- - s2+ = 100
x1 + 2x2 < 10
x1 <6
x1, x2, s1-, s1+, s2-, s2+ >0

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 1. Complete LP1


Maximize p1 = 4x1 + 8x2
Obstacles:
x1 + 2x2 < 10
x1 <6
x1, x2 >0
The optimal solution (obtained by TORA) is x1 = 0, x2 = 5 with p1 = 40, which indicates that
the maximum broadcast reach that can be obtained is 40 million people.

• 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:

Table 8.3 Iterations 1 and 2

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.

LP2 (cost minimization). The column derivation rule eliminates s1 (with zj – cj = 4 in


LP1). We can see from row-P2 that if s1 is not omitted, it will be the variable entered at the
beginning of iteration-P2 and will result in the optimum solution x1=x2=0, which will decrease
the optimum objective value of problem P1 from P1=40 to P1= 0. Problem P2 is minimization.
After eliminating si, the variable x1 with zj – cj = 4 (> - 0) can increase the value of P2. The
following table shows the LP2 iteration. The Pi-line has been removed as it is useless in LP2
optimization.

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.

Solving Goal Programming using Python

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.

min z = 60x1 + 40x2

s.t. 4x1 + 4x2 ≥ 10


2x1 + x2 ≥ 4
6x1 + 2x2 ≤ 12
x1 ≥ 0, x2 ≥ 0

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.

9.1 Definition of Transportation Model


The transportation model is a type of linear programming, which specifically aims to
minimize the total cost of shipping a homogeneous number of goods from several sources or
companies to several destinations or markets. To better understand this transportation problem,
consider the example below.
Three factories A, B and C produce sugar and are located in various regions. Factory A
produces b1 tons of sugar per year and B produces b2 tons of sugar per year and C produces
b3 tons of sugar. The sugar is needed by four markets W, X, Y and Z. The needs of the four
markets are as follows: The demand for sugar in Markets W, X, Y and Z is d1, d2, d3, and d4
tons, respectively. The cost of transporting one tonne of sugar from each mill to the market is
given in the matrix below. The goal is to transport sugar from the factory to the market with
minimum total transportation costs.

Table 9.1 Examples of transportation models


From the data above, we can write it into a mathematical model as follows:
Min Z = c11 x11 + c12 x12 + c13 x13 + c14 x14 + c21 x21 + c22 x22 + c23 x23 + c24 x24 +
c31 x31 + c32 x32 + c33 x33 + c34 x34
Or it can be written:
Min Z = j=1ni=1mcijxj where i = 1 to m, and j = 1 to n.
Constraint function:
1. a11 x11 +a12 x12 + a13 x13 + a14 x14 b1
2. a21 x21 + a22 x22 + a23 x23 + a24 x24 b2
3. a11 x11 + a21 x21 + a31 x31 d1
4. a12 x12 + a22 x22 + a32 x32 d2

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.

9.1.1 The Northwest-corner Method of Transportation Problems


Many ways cansa is used to find a solution to the linear program transport model,
among others withNorthwest Corner method. This method has l step in determining the initial
solution by doing an allocation that starts with from the top left corner (North West) to the
bottom right corner (Southeast/Southeast). Next, the allocation is made to box X[i,j+1] when
the demand in column j has been fulfilled and to box X[i+1,j] when the demand in row i has
been fulfilled.
For example, let's try to solve the problem shown in the table below:

Figure 9.1 Completion of the Northwest-corner method

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

There are no more positive non-basic variables

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

The steps in using the Least-Cost method are as follows:


1. Start from the leftmost column (1) and choose the route with the lowest cost. Adjust the
requested demand, maximize it while still paying attention to the existing supply. If supply
is maximized but demand has not been met, then in the same column choose the route with
the next lowest cost (second lowest).
2. If the demand in the first column has been met, then proceed to the next column (2). Same
as before, started by choosing the route with the lowest cost, then try to maximize it to fulfil
demand while still looking at the existing supply.
3. This process continues until the last column, until the maximum demand is met and the
supply is optimally channelled.
So that the total costs incurred are:
z = (50 * 5) + (10 * 10) + (20 * 20) + (70 * 10) +( 60 * 15) = $2350

9.1.3 Vogel approximation method on transportation problems


Vogel is a method developed from the Least-Cost method. In general, this method
yields a better Least-Cost solution, but this is not always the case apply in certain
circumstances. The Vogel method is carried out by following these steps:
1. For each row and column, calculate the value of penalty obtained from the difference
between the two lowest costs. This is used to measure the value of missed opportunities
when a box with the lowest cost is not selected.
2. Identify the rows and columns that have the value penalty highest. In that row or column,
select the box with the lowest cost and adjust the amount of demand fulfillment with the
availability of supply so that it is maximized. Allocate as many choices as possible to the
variable with the least unit cost in the selected row or column. If a column has been met,
then the column is crossed out, and a demand value of 0 is given. Then the value of penalty
customized.
3. Perform the above steps until the demand column has been met. An example of using the
Vogel method can be seen in the image below.

80
Figure 9.5 Solving the Least-cost method

So that the total costs incurred are:


z = (50 * 5) + (10 * 10) + (20 * 20) + (70 * 10) +( 60 * 15) = $2350

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

Figure 9.6 Solving the Least-cost method

81
3. After that, enter the cost, supply, and demand data in the column

Figure 9.7 Solving the Least-cost method

4. Select the starting method you want to use, then click solve, so that the most optimum
results appear

Figure 9.8 Solving the Least-cost method

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:

Table 9.2 Production inventory and transportation models


The unit cost of "transportation" from period i to period j is calculated as follows:
Cij={production cost in i, i=j production cost in i+additional cost from i to j, i<j production
cost in i+penalty cost from i to j, i>j

The resulting transportation model can be presented as in the following table:

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.

Figure 9.9 Optimal solution

9.2 Assignment Model


The most classic assignment model is concerned with the division of workers, who have
diverse abilities, into several jobs (jobs), assuming a variety of skills influence the cost of
completing a job. Similar to the transportation model, the main objective function of the
assignment model is to minimize the time or cost of producing a product by allocating one job
to another something machine or one machine to one job or one destination to one origin or
one origin to one destination only. The general assignment model with n workers and n jobs
can be seen in the figure ...

Figure 9.10 General assignment model


Consider the following example as an assignment model.
There are 4 jobs, W, X, Y and Z to be assigned to the four machines, A, B, C and D.
W's job is to drill 1.5-inch holes in a plank of wood. X's job is to drill a one-inch hole in the
Aluminium plate. Y's job is to drill a half-inch hole in the steel plate. Z's job was to drill a half-
inch hole in the brass plate. Machine A is a drilling machine type Pillar, machine B is a Bench
type drilling machine. Machine C is a radial drilling machine and machine D is an automatic
drilling machine. All machines can do all the work or all jobs can be done on any machine. The
cost or time of doing work on a particular machine will differ from that of another machine,
due to overhead and operating and tooling costs. The aim of this case is to minimize the time

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.

Table 9.3 Examples of problems


Mathematical models:
Objective function Min Z = j=1ni=1ncijxij
Constraint function:
Xij= (Xij)2 where i and j = 1 to n
J=1nXij=1 dj and i=1nXij=1 bi for i and j = 1 to n
Xij= 0 for all values of j and i

There are several types of problems in this assignment model, including:


1. Assignment of jobs/jobs to multiple machines. The goal here is to minimize the time needed
to complete the job, where the number of jobs is equal to the number of machines.
2. Maximization in assignment problems. Here we have to assign certain jobs to certain
facilities to maximize profit or maximize effectiveness.
3. An assignment problem that has a non-square matrix. Here a non-square matrix can be
converted into a square matrix by adding dummy rows or columns to solve it.
4. Assignment problems with constraints. Limitations here are like work that cannot be
performed on a particular machine or cannot be allocated to a particular facility. In such
cases there is often a sizable penalty if the work goes to unwanted machines or facilities.
5. Traveling Salesman Program (TSP). Here a vehicle must go around certain cities starting
from a point until returning to the same point after visiting all cities. This type will be
discussed more complete in the next chapter.

9.2.1 Hungarian Method on Assignment Problems


One technique for solving assignment problems is the Hungarian Method. To better
understand it, consider the example below.
Joe Klyne's three children, John, Karen, and Terri, want to make money for personal
expenses. Klyne has chosen three tasks for her children: mowing the lawn, painting the garage
door, and washing the family car. To avoid the anticipated sibling rivalry, Klyne asked his three
children to submit individual bids for what they felt was fair pay for each of the three tasks. A
summary of payment offers can be seen in the table below. Children will obey their father's
decisions regarding assignment.

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.

Figure 9.11 Solution

Completion of assignments using python:

Figure 9.12 Solution in python

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

9.4. Example of Implementation Case


One of the challenges in the transportation model is the problem of complex cargo delivery
scheduling problems. Cargo delivery scheduling is a series of transportation of goods in large
and large quantities in a limited time. Cargo scheduling issues involve vehicle routing, vehicle
scheduling and delivery, cargo network flow, cargo consolidation, and others. On the other
hand, in optimizing the delivery schedule, there are forward and reverse logistics. Discussions
related to forward and reverse logistics are often separate, resulting in a less than optimal
solution. Thus, the concept of Integrated Reverse Logistics Problem (IRLP) emerged, which is
a type of logistics network where forward and reverse logistics are designed in an integrated
manner, both in terms of facilities, transportation routes, and transportation schedules.
Research conducted by Djatna and Amien (2019), answers this problem by proposing a non-
dominant-II genetic sorting algorithm model. This model produces the best solution related to
transportation with minimum costs and order responsiveness, while meeting all forward
logistics and reverse logistics constraints.

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.

10.1 Minimum Spanning Tree


Minimum Spanning Tree (MST) is a graph that has a limit where all the vertices in the
graph are connected without any cycles in it and have the minimum total edge weight. A cycle
is a route in a graph that starts and ends at the same vertex. Minimum Spanning Tree is widely
used in the case of determining the length of the cable, network (LAN), and determining the
length of the pipe. For example, Figure 10.1 is an illustration of a water pipe layout for an agro-
industrial company. Water is an important component so that it must be channeled to all rooms
in the agro-industrial company. The plumbing technician must be able to channel the water
throughout the room with the most efficient total length of the pipe. An illustration of the MST
completion of Figure 10.1 is shown in Figure 10.2.

Figure 10.1 Pipeline Plan

Figure 10.2 MST completion results

10.1.1. Prim Algorithm


In Prim-Jarn´ık's algorithm, we grow the minimum spanning tree of a single cluster
starting from several "root" vertex s. The main idea is similar to Dijkstra's algorithm. We start
with some points, defining the initial "cloud" of vertex C. Then, in each iteration, we choose
the minimum weight edge e = (u, v), connecting point u in cloud C to point v outside C. Vertex
v then brought to cloud C and the process is repeated until tree spanning is formed. Again, the
important fact about the minimum spanning tree comes into play, because by always choosing

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.

Figure 10.3 Illustration of Prim . Algorithm

10.1.2. Kruskal Algorithm


Initially, each point in a cluster, by itself is singular. The algorithm then considers each
edge in order, sorted by increasing weight. If edge e connects two different clusters, then e is
added to the set of minimum spanning edge trees, and the two clusters connected by e are
merged into a single cluster. If on the other hand, e connects two nodes already in the same
cluster, then e is discarded. Once the algorithm has added enough edges to form a tree the
panning ends and outputs this tree as the minimum spanning tree.

Figure 10.4 Illustration of Kruskal's algorithm

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.

Figure 10.5 Illustration of Boruvka algoritma algorithm


10.1.4. Minimum Spanning Tree Algorithm Using Python
Python is a multipurpose dente shrimp programming prawn with a design philosophy
focused on code readability. Python is claimed to be a shrimp that combines capabilities,
capabilities, with a very clear code syntax, and is equipped with large and comprehensive
standard shrimp functionality. Various algorithms in the minimum spanning tree such as Prim,
Kruskal and Boruvka can be implemented using python programming.

10.2 Travelling Salesperson Problem


Classically, the TSP problem is concerned with finding the shortest tour route in an n-
city situation, where each city is visited exactly once before returning to the starting point. the
associated TSP model is defined by two pieces of data:

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.

Figure 10.6 PCB illustration


The image above shows a small example to be investigated for a whiteboard
manufacturer. The manufacturer searches for the optimal route through the 10-hole locations
indicated. The figure above reports the straight-line distance at, j between hole locations i and
j. The lines in the image represent a fair quality solution with a total length of 92.8 inches.
Another very common case in TSP is how the postman delivers the mail to the recipient.
He arranges all the letters in order and starts from the post office and goes from recipient to
recipient and finally back to his post office. If he doesn't arrange the posts in order, he may
have to travel a long way to complete all the posts. Likewise, a traveling salesperson should
plan his visits. Say, he starts at his head office and goes around the branch offices and returns
to his head office. While on a trip he will not visit the branches already visited and he will not
return until he has visited all the branches.
as explained above, the TSP model is determined by the number of cities n and the
distance matrix ||dij||. The definition of a tour route prohibiting connecting a city to the city
itself is to assign a very high penalty to the diagonal elements of the distance matrix. A TSP is
symmetric if dij = dji for all i and j; otherwise, it is called asymmetric. TSP is symmetric if the
distance or cost of traveling from point i to another point j is equal to the distance from j to i.
Defined:
xij={1, if city j reached from city i 0, otherwise}
TSP Objective Functions To be:

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.

Figure 10.7 Illustration of case settlement

10.3 Maximum Flow


There is a network of pipelines that transport crude oil from oil wells to refineries.
Intermediate boosters and pumping stations are installed at specified distances to move crude
oil in the network. Each pipeline segment has a limited discharge rate or capacity of crude oil
flow. Pipe segments may be unidirectional or bidirectional, depending on the design. The figure
below shows a typical pipeline network. The purpose of this problem is to determine the
maximum flow capacity of the network.

93
Figure 10.8 Illustration of a pipeline

In general, the maximum flow problem can be described as follows:


1. All flow through a routed and connected network originates at one node, called the
source, and ends at another node, called the sink.
2. All remaining nodes are transhipment nodes.
3. Flow through a line is only allowed in the direction indicated by the arrow, where the
maximum amount of flow is given by the capacity of that line. At the source, all the lines
point away from the node. Here all arcs point to nodes.
4. The goal is to maximize the amount of flow from the source to the tub/sink. This amount
is measured by one of the equivalent paths, that is, the amount leaving the source or the
amount entering the sink.
The following are some types of application of the maximum flow problem:
1. Maximizing flow through the company's distribution network from its factories to its
customers
2. Maximizes flow through the company's supply network from its vendors to its factories.
3. Maximizes oil flow through pipelines.
4. Maximizing flow of water through the drains.
5. Maximize the flow of vehicles through the transportation network.

a. Augmenting Algorithm Path for Maximum Flow case


To summarize, each iteration of the algorithm consists of three track following:
1. Identify augmentation paths by finding multiple directional paths from source
to sink in the residual network so that each line in this path has a highly positive
residual capacity. (if there is no augmentation path, the predefined net flow is
the optimal flow pattern.)
2. Identify the residual capacity c* of this augmentation path by finding the
minimum residual capacity of the line in this path. Increase the flow in this path
by c*.
3. Decrease by c* the remaining capacity of each line on this augmentation path.
Increase by c* the residual capacity of each line in the opposite direction of this
augmentation path. Back on track.

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).

Figure 10.9 Initial residual network

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

Figure 10.10 Iteration 1

Iteration 2: assign flow 3 to the augmentation path O-A-D-T. The resulting residual
network is

Figure 10.11 Iteration 2

Iteration 3: assign flow 1 to augmentation path O-A-B-D-T

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 5: assign stream 1 to the O-C-E-D-T augmentation path.

Iteration 6: assign flow 1 to the O-C-E-T augmentation path. The resulting residual
network is

Figure 10.13 Iteration 6

Iteration 7: assign flow 1 to the O-C-E-B-D-T augmentation path. The resulting residual
network is

Figure 10.14 Iteration 7

There is no longer an augmentation path, so the current flow pattern is optimal.

a. Complete the maximum flow by programming linear using MS Excel


The path of the maximum flow problem that appears in practice is much larger than
the example above. Some problems have thousands of nodes and lines. The path
augmentation algorithm just presented is much more efficient than the general simplex
method for solving such large problems. However, for medium size problems, a rational
and easy alternative is to use Excel and a solver based on the general simplex method.

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.

10.4 Minimum Cost Flow


The minimum cost flow problem holds a central position among network optimization
models, because it covers such a wide class of applications and can be solved very efficiently.
As with the maximum flow problem, shrimp consider flow through a network with limited arc
capacity. Like the shortest path problem, it considers the cost (or distance) for flow through
arcs/lines. Such as transportation problems or assignment problems, i.e. can consider multiple
sources (supply nodes) and multiple destinations (demand nodes) for flow, again with
associated costs.
The minimum cost flow problem can be solved very efficiently because it can be
formulated as a linear programming problem so that it can be solved by a simplified version of
the simplex method called the network simplex method. The minimum cost flow problem is
described below:
1. The form of the network is a directed and connected network.
2. There is at least one node as a supply node.

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).

Some applications of the minimum cost flow problem:

Application realm Supply node Transhipment Request node


nodes
Operation of distribution Origin/source of Intermediate storage Customer
network material facilities
Solid waste management Source of solid Processing facilities Landfill location
waste
Operation of supply Vendor warehouse between Processing
network facilities
Coordination of mixed Factory Production of a Market of
products in a factory specific product specific products
Cash flow management Source of cash at a Short term Cash needs at a
certain time investment options certain time
Table 10.1 Application of Minimum Cost Flow problems

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

The value of bi depends on the nature of node i, where


Bi> 0, if node i is supply node
Bi> 0, if node i is a request node
Bi= 0, if node i is a transhipment node

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:

With constraint function:

For each node i,

For each arc/line i -> j

Example:

Figure 10.16 Example problems

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.

The linear programming model of the above example is:

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.

Figure 10.17 Troubleshooting with Solver in Microsoft Excel

10.5 Multi-Commodity Flow


Some physical commodities, vehicles or messages are each governed by their own
network constraints, sharing the same network. For example, in telecommunications
applications, telephone calls between a specific pair of nodes in the underlying telephone
network, each defining a separate commodity. If the commodity does not have any interaction,
then to solve the problem with multiple commodities, it can be solved by solving each single
commodity problem separately using the techniques discussed in the previous discussion.
However, in other situations, because the commodities have the same facilities, the individual
single commodity problems are not independent, so to find the optimal flow we need to solve
the problems simultaneously. In this section you will study a model known as the multi-
commodity flow problem. A multi-commodity flow problem is a network flow problem with
multiple commodities (request flows) between different source nodes and sinks. That is, each
arc has a capacity Uij which limits the total flow of all commodities in that arc.

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.

Sometimes in this discussion, it is easier to express the constraint of bundle (10.b) as


an equation rather than an inequality. In this case, a non-negative “slack” variable Sij is
introduced and the bundle constraint is written as follows:

(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

Figure 10.18 Optimal Warehousing for Seasonal Products

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

1. Understanding CPM, PERT and PDM Network Methods


The usual work diagram in project management terms is called an activity network
diagram. This diagram serves as an analytical tool related to the project completion schedule,
the possibility of project completion, problems that may arise when project delays occur,
additional costs for project acceleration and so on. The types of project network diagrams
commonly used are CPM, PERT and PDM.
2. CPM (Critical Path Method)
CPM is a network diagram technique introduced by Walker and Kelley in 1957. CPM
has a function to determine the duration of various stages in working on a project with certainty,
and to determine the relationship between the resources used and the time required to complete
a project.
CPM has the same networking technique as PERT. The difference is that CPM uses
event oriented, while PERT uses activity oriented. In event oriented, events become the focus
of attention of an activity, while in activity oriented, arrows describe the work of several
descriptions of the activity.
CPM is a network analysis technique that aims to optimize the total project cost by
reducing the project completion time. The critical path is the longest path duration of a network.
The critical path means that activities on it cannot be delayed without delaying project work.
The critical path has four parameters to identify each activity, namely:
ES – earliest start time: earliest time at which the activity can start given that the precedent
activity has to be completed first.
EF – earliest finish time, equal to the earliest start time for the activity plus the time it took
to complete the activity.
LF – last finish time: the last time the activity could be completed without delaying the
project.
LS – last start time, equal to the last finish time minus the time it took to complete the
activity.
.
3. PERT (Program Evaluation and Review Technique)
The PERT method was first introduced by the US Navy Special Projects Office in
collaboration with Booz, Allen and Hamilton on the Polaris missile development project for
the Nautilus submarine in the US in 1958. PERT is a project management technique whose
goal is to accelerate project completion by reducing as much as possible the associated delays
or interruptions in activities as well as coordinating various parts of a job as a whole. The use
of this method allows the creation of an orderly and controlled project activity because the
schedule and budget have been determined in advance before the project is implemented.

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

4. PDM (Precedence Diagram Method)


PDM was developed in the early 1960s by JW Fondahl of Stanford University. CPM
and PERT have a fundamental difference in time estimates. CPM estimates the time of project
activities in a deterministic way, while PERT predicts a probabilistic way. The PDM technique
has a simpler network because activities are only described in the form of nodes (nodes or path
connections), not on arrows as in CPM and PERT. The method for describing activities on a
node is called the AON (activity on node) diagram method, while the method for descri bing
activities on an arrow line is called the AOA (activity on arrow) or ADM (arrow diagramming
method) diagramming method.

5. Network Method Application (CPM, PERT dan PDM)


The calculation of activity time uses three basic assumptions, namely: First, the project
only has one initial event (start) and one terminal event (finish). Second, the fastest time for
the initial event to occur is day zero. Third, the latest time the terminal event occurs is LS =
ES. The calculation method in determining the completion time consists of two stages, namely
forward computation and backward computation.

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:

Figure 11.1 Slack Calculation Circle


Information:
a = space for event number
b = space to show the fastest time for events (E) and activities (ES) which are the results of
advanced calculations
c = space to show the latest time for the event (L) and the activity that is the result of the
countdown. For more details, in carrying out forward and backward calculations in a network,
the following illustration is given.

An example of calculating the amount of project completion time and its total slack.

Figure 11.2 Calculation of Total Project Completion and 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:

Figure 11.3 Calculation of the Third Rule

If EF(c) > EF(b) > EF(a), then ES(d) = EF(c)


Then: EF(5-6) = EF(4-5) + D = 13 + 3 = 16 (16 days turnaround time)

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.

Figure 11.4 Calculation of the Fifth Rule

If LS(b) < LS(c) < LS(d) then LF(a) = LS(b)


So: LF(1-2) = LS(2-3) = 2 and LS(1-2) = EF(1-2) – D = 2 – 2 = 0

Slack or Float Calculation


• Sixth Rule
Slack Time or Total Slack (TS) = LS – ES or LF – EF
So that the results of the calculation of EF, LF and slack are obtained as shown in the following
table.

Table 11.1 Results of the Calculation of EF, LF and Slack

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.

Figure 11.5 Arrow PERT


Information:
Activities A and B are Preliminary activities
Activity C is done after activity A
Activity D is done after activity B
Activity E is done after activities C and D

NO Rule Illustration

One activity can only be represented


1
by one arrow

There are no 2 activities indicated by


2 the tail of the event and by the event
the same one.

To solve problems like the one


3
above, a dummy activity was created

• What activities must be completed before


this activity is carried out?
To ensure the correct order
• What activities should follow these
4 relationship, it is necessary to make
activities?
a list of questions
• What activities must be done
simultaneously?

Table 11.2 PERT Rules

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

Table 11.3 Problems Example

The results of the PERT diagram are shown as follows:

Figure 11.6 PERT Diagram Diagram

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

Figure 11.8 Parts of PERT Circle


Slack
Slack shows the time activities that can be delayed without affecting the total completion time
of the entire project. To calculate the amount of slack, two other times are needed related to
each activity, namely the longest start time (LS) and the earliest finish time (EF).

Table 11.4 Total Slack

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

1 Start to Start (SS)

2 Start to Finish (SF)

3 Finish to Start (FS)

4 Finish to Finish (FF)

Table 11.5 PDM Illustration

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.

Table 11.6 PDM Problems Example

113
The working steps of the PDM method:
1. Make a stain plan according to the number of activities

Gambar 11.9 Node Plan


2. Connect the nodes (activities) according to the constraints using arrows

Gambar 11.10 Total Activity Nodes


3. Complete the attribute details on each stain
4. Calculate ES, EF, LS, and LF to identify critical activities
The results of the ES, LS, EF, and LF calculations can use the forward and backward counts
as follows:
Count Forward
• Activity A
Considered starting early = 0
ES(l ) = 0
EF(l ) = ES(l) + D(A) = 0 + 5 = 5
• B . Activities
ES(2) = ES(l ) + SS(l-2) = 0 + 3 = 3
EF(2) = ES(2) + D(B) = 3 + 6 = 9
• C activities
ES(3) = EF(2) + FF(2-3) - D(C) = 9 + 2 - 6 = 5
ES(3) = EF(1) + FS (1-3) = 5 + 2 = 7

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

Figure 11.11 Forward Count Results


Countdown
Starting from the last activity F
LF(6) is equal to EF(6) = 24 (project endpoint)
• E Activities
LF(5) = LS(6) - SS(5-6) + D(E) = 16 - 5 + 6 = 17
LS(5) = LF(5) - D(E) = 1 7 - 6 = 11

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:

Figure 11.12 Critical Path Results

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

Using the Python programming language in the Spyder Anaconda IDE:


You need to install the pandas_ods_reader package first.

Figure 11.13 Install Package pandas_ods_reader

Figure 11.14 task.py

117
Figure 11.15 main.py

Figure 11.16 Output


You can see the coding file along with the explanation video athttp://ipb.link/material-
responsi-po.

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.

Figure 11.17 Microsoft Project Main Page

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.

6. Analysis of the use of the CPM/PERT/PDM method in the case of agroindustry


In this section we will try to apply the methods we have learned previously to the case
of the agro-industry domain. Further case analysis will be explained in the next chapter
(Chapter XII), but in a simple way, let's try to solve the following agro-industry problems.
Most local beverage SMEs fail to enter the modern retail market. Suppose your
company believes that in the next 5 years the market demand for brown rice brand drinks will
increase, as consumers' understanding of functional foods increases. In your opinion, market
failures that often occur are influenced by packaging designs that are not in accordance with
consumer needs. Consumers want a packaged drink that is modern, contemporary, easy to
carry, easy to store, trendy but also maintains the functional benefits provided. Your manager
is optimistic that he will succeed in this market so he formed a team to design, develop and
produce this brown rice tea bottled drink which will be successful in the market in less than 1
year. Your supervisor stated that the management meeting will be held several months before
the time of the expo agenda by the Ministry of Industry. Your team is targeted to be able to
make the prototype within 35 weeks. You are appointed as the chief executive of the team and
are in charge of making the network and determining whether the plan can be completed within
that time, and asked to provide analysis and reasons for the plan made.
First, we list the activities in order. This is based on the situation in the field for which
we obtained the data.

Activity Time Preceding


Activity Description
Code (Sunday) Activities
Designing brown rice beverage
A 21 -
packaging
B Making prototypes 5 A
C Evaluate the equipment used 7 A

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

Figure 11.19 Forward Count Results


So, from the results of advanced calculations obtained, we can see that the fastest
completion time is 36 weeks (exceeding the specified target). From this we need to report to
management and re-check the data that was previously obtained, for example verifying the
packaging design time can be shortened by adding new team members.

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

11.1 Calculation of Coffee Production Work


Indojaya Lestari Company is a coffee processing company located in Tabanan, Bali. The
company plans to make a new product, Specialty Coffee from Kintamani. The company then
prepares a work plan. However, the owner of the company considered that the design was not
appropriate. The following is a project activity plan.

Table 12.1 Activity plan

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

Based on the above calculation, the network can be created:

Figure 12.1 Network illustration

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.

Table 12.3 Calculation of project completion opportunities

The Z value, if we look at the standard distribution function table:

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.

11.2 Lychee Flavour Wafer Production Scale Up Project


PT. Nangka Adi Luhur is a lychee-based canned food manufacturer that has just entered
the wafer market. The company's products were selling well, so it was decided to increase the

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

The time required to complete all these activities is:

Table 12.5 Activity completion time

The provisions of these activities are:


1. A and B are the start of the project
2. C and D start when A finishes
3. E can start when B and D finish
4. F can be started when B, C and D are finished and is the final activity
5. G can be started when F is finished and is the final activity.

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:

Table 12.6 Calculation in problem solving

127
Then, we can describe the network of activities in this project, namely:

Figure 12.2 Network illustration

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

To complete it in 22 weeks, the odds are:

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

13.1 Definition of Duality and Sensitivity Analysis


Dynamic programming is a mathematical technique commonly used for making a
decision from a series of interrelated decisions. This programming was first developed by
scientist Richard Bellman in 1957. Dynamic programming has a systematic procedure to
produce optimal combinations of decisions by maximizing overall effectiveness so as to
facilitate solving optimization problems that have certain characteristics. The dynamic
programming that will be discussed in this chapter is deterministic dynamic programming.
Dynamic programming is different from linear programming which has the formula
standard mathematical (formula) Dynamic programming uses a general approach to solve a
problem. The specific equation to be used must be developed first according to each individual
situation. Dynamic programming requires general structure of the problem to determine
whether a problem can be solved by dynamic programming procedure or not and how it is
done. Terms commonly used in dynamic programming include:
a. The stage is the part of the problem that contains the decision variables.
b. Alternatives, at each stage there are decision variables and objective functions that
determine the value of each alternative.
c. State, state shows the relationship of one stage to another stage, so that each stage can be
optimized separately and can produce proper optimization results for all problems.

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.

13.2 Recursive Nature in Dynamic Programming


The main idea of Dynamic Programming is to break down a problem into (more
manageable) subproblems. The calculation is then performed recursively where the optimal
solution of one sub-problem is used as input for the next sub-problem. The optimal solution
for the whole problem is imminent when the last subproblem is solved. How the recursive
computation is done depends on how the original problem is described. In particular,
subproblems are usually linked by common boundaries. The feasibility of this general
constraint is maintained across all iterations. In its use, this recursive principle can be done
forward (forward recursion) or backwards (backward recursion).

13.3 Dynamic Programming Concepts in Case Examples in Agroindustry


The dynamic program approach has the basic principle that each problem can be divided
into the smallest parts (stages or decision points) with the aim of facil itating the evaluation
stage. Therefore, dynamic programming is also known as a multi-process model or a stage
model. The following is an example of using dynamic programming concepts in the shortest
route problem or finding the shortest distance. An example of a case in supply chain problems
is in the seaweed industry where it was investigated by Djatna and Sarinah (2015) regarding
risk management strategies for supply shortages. In this example, Dynamic Programming can
also be used to find efficient distances in supply chain and industrial logistics systems. One of
the parameters calculated in the logistics system is related to the delivery process where it is
related to the production cycle, delivery accuracy, and delivery lead time. One of the factors to
achieve the three parameters is the selection of the shortest distance so as to minimize the
distance to be traveled. This can be done using dynamic programming principles.

13.3.1 Examples of Problem Solving in Agroindustry Using Dynamic Programming


A seaweed agro-industry will ship products from Bekasi to Bali for distribution to areas
crowded with tourists. The journey to Bali can be taken through the city which is abstracted in
the graph as follows:

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 Dynamic Programming in the Knapsack Problem


The knapsack problem is a subset of combinatorial optimization problems which has the
following abstraction: You are given a knapsack with the maximum weight, and you must
select a subset of the given items in such a way that the amount of profit is maximized without
exceeding the capacity of the backpack. Knapsack problems are NP-hard and arise very often
in practical real-life situations. The dynamic programming solution to the knapsack problem
runs in pseudo-polynomial time. The problem in the Knapsack problem is a general resource
allocation model where limited resources are used by a number of economic activities. The
goal is to maximize the return on total value. There are two types of knapsack problems, namely
0/1 Knapsack and Integer Knapsack.

13.4.1 0/1 Knapsack Problem


The basic principle of the 0/1 knapsack problem is that we must optimize the objective
function by choosing one type of available resource and combining it with several other
resources. The abstraction of this problem is when we have a number of items with each weight
x, y, z….., etc., they will be put into a bag that can carry a maximum load of 15 kg.
Automatically not all items can not be included in the bag. To maximize the available luggage,
we can use 0/1 knapsack dynamic programming to solve this problem.

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

4. w the weight 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.

13.4.5 Dynamic Programming on Workforce Size Model


Manpower requirements in construction projects can be met through the recruitment
and firing of workers. Both activities incur costs. The goal is to minimize the total cost of labor
required for the project.
Assume that the project duration is n weeks and the minimum labor force required in
week i is worker bi. The model assumes that additional costs are incurred if one week of labor
exceeds the minimum requirement or if additional hiring takes place within a week. For
simplicity, no fees are incurred when additions occur.
The cost of keeping labor xi greater than the minimum bi in week i creates a cost excess
of C1(xi - bi). If xi > xi-1, recruitment occurs at an additional cost of C2(xi- xi-1). The elements
of the DP model are defined as follows:
1. Stage i is represented by week i, i = 1, 2, …, n.
2. The alternative at stage i is xi, the number of workers in week i.
3. The state at stage i is xi-1, the number of available labor in week i - 1. The recursive
equation for DP is given as fn + 1(xn) = 0 fi(xi-1) = min xi bi{C1( xi-bi) + C2(xi - xi-
1) + fi + 1(xi)}, i = 1, 2, …, n The calculation starts at step n and ends at stage 1
(backward recursion).

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
*

8 3 (0) + 0 + 8 = 8 3 (1) + 0 + 6 = 9 3 (2) + 0 + 8 = 6 6 6


Table 13.3 Stage 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
*

5 3 (0) + 4 + 2 (2) + 12 = 20 3 (1) + 4 + 2 (3) + 6 = 19 19 8


6 3 (0) + 4 + 2(1) + 12 = 18 3 (1) + 4 + 2 (2) + 6 = 17 17 8
7 3 (0) + 0 + 12 = 12 3 (1) + 4 + 2 (1) + 6 = 15 12 7
8 3 (0) + 0 + 12 = 12 3 (1) + 0 + 6 = 9 9 8
Table 13.5 Stage 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
*

0 3 (0) + 4 + 2(5) 3 (1) + 4 + 2(6) 3 (2) + 4 + 2(7) 3 (2) + 4 + 2(8) 33 5


+ 19 = 33 + 17 = 36 + 12 = 36 + 12 = 35
Table 13.6 Stage 1
The conclusion that can be drawn is that the optimum solution can be achieved if the value of
each variable is
X =0
0 X =5
1 X =52 X =8
3 X =6
4 X =6
5

This solution can be abstracted in the following plan:


Week- Minimum number The actual number Decision Cost
i of workers (bi) of workers (xi)
1 5 5 Hiring 5 workers 4 + (2 x 5) = 14
2 7 8 Hiring 3 workers 4 + (2 x 5) + (1 x
3) = 13
3 8 8 - 0
4 4 6 Fire 5 workers (3 x 2) = 6
5 6 6 - 0
Table 13.7 Solution abstraction
The total cost is f (0) = $3300
1

13.4.7 Dynamic Programming on Equipment Replacement Models


Manpower requirements in construction projects can be met through the recruitment and
firing of workers. Both activities incur costs. The goal is to minimize the total cost of labor
required for the project.
Machines that last longer lead to higher maintenance costs and have consequences for
replacement several years later. This situation relates to determining the most economical age
of a machine. Suppose the engine replacement problem lasts n years. At the beginning of each
year, the engine will remain in operation for an extra year or be replaced with a new one. Let
r(t), c(t), and s(t) represent the annual revenue, operating costs, and salvage value, respectively,
of the t-age machine. The cost of acquiring new machines each year is I. The elements of the
DP model are as follows:
1. Stage i is represented by year i, i = 1, 2, …, n
2. The alternative at stage (year) i is to maintain (K / keep) or replace (R/replace) machine at
the beginning of the year i.
3. The state in stage i is the age of the machine at the beginning of year i

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.

13.4.9 Dynamic Programming in Capital Budgeting Problem


This problem or case has also been discussed in chapter 7. However, this chapter will
explain how to solve the capital budgeting problem using a dynamic programming approach.
For example, a company has a plan to expand its business activities (projects) through
the development of its three factories (plans). Each factory is expected to send proposals
(maybe more than one) for the project to be developed to the company. Each proposal must
contain the total cost required (c) and the total profit (revenue) that will be obtained (R) from
the business development that will be carried out. The company has a budget allocation of Rp
5 billion for the development of its three factories. A summary of the c and R values of each
project proposal is in accordance with the following table. A project proposal with a score of 0
indicates that there is no budget allocation for each factory. The company's goal is to get the
maximum profit from the planned allocation of development funds of Rp 5 billion.

Project Factory 1 Factory 2 Factory 3


C 1R C1 R2 C2 R 3 3

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.

13.4.10 Dynamic Programming in Investment Model


Suppose you want to invest the amount P1, P2, . . ., Pn at the beginning of each of the
next n years. You have two investment opportunities in two banks: First Bank pays and interest
rate r1, and Second Bank pays r2, both compounded annually. To encourage deposits, both
banks pay bonuses on new investments in the form of a percentage of the amount invested. The
bonus percentages for First Bank and Second Bank are qi1 and qi2 for year i, respectively. The
bonus is paid at the end of the year in which the investment is made and can be reinvested in
any of the banks in the following year immediately. This means that only bonuses and new
money can be invested either by the bank. However, once the investment is deposited, it must
remain in the bank until the end of n years.
The Dynamic Programming elements of the above problem are as follows:
1. Stage i is represented by year i, i = 1, 2, c, n.
2. Alternatives in stage i are Ii and II, the amount invested in First Bank and
Second Bank, respectively.
3. The state, xi, at stage i is the amount of capital available for initial investment
year i.

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

final amount of money from the investment.

The equation for Backward Dynamic Programming Recursive is as follows:

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

As given before, x defined in terms x i+1 i

13.4.11 Example of Problem Solving Using Dynamic Programming Investment Model


Question:
Suppose you want to invest $4000 now and $2000 at the beginning of year 2 to year 4.
The interest rate offered by First Bank is 8% compounded annually, and bonus over the next 4
years are 1.8%, 1.7% respectively. , 2.1%, and 2.5%. The annual interest rate offered by Second
Bank is 0.2% lower than First Bank, but the bonus is 0.5% higher. The goal is to maximize
capital accumulation at the end of 4 years.

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

• q = 0.018, q = .017, q = .021, q = .025


11 21 31 41

• q = 0.023, q = .022, q = .026, q = .030


12 22 32 42

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

x = 2000 - 0.005I + 0.026x


4 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

= max { 2216 - .00122I + 1.1909x } 3 3

0I X ≤ 3≤ 3

State Optimum Solution


F (x ) I* 3 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

x = 2000 - 0.005I + 0.022x 3 3 3

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

= max { 4597.8 - 0.0010305I + 1.27893x } 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

X = 2000 - 0.005I + 0.023x


2 1 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

= max { 7157.7- 0.00365I + 1.37984x } 1 1

0 I X
≤ 1≤ 1

State Optimum Solution


F (x )
1 1 I* 1

X 2 7157.7+ 1.37984x $4,000 1

Work backwards and pay attention I * = 4000, I * = x , I * = I * = 0, we will get:


1 2 2 3 4

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

So that the optimum solution can be summarized as follows


Year Optimum Solution Decision Accumulation
1 I * = x1
1 Invest x1 = $4000 in First Bank s1 = $5441.80
2 I * = x2
2 Invest x2 = $2072 in First Bank s2 = $2610.13
3 I *=0 3 Invest x3 = $2035.22 in Second Bank s3 = $2365.13
4 I*=0 4 Invest x4 = $2052.92 in Second Bank s4 = $2274.64
Total accumulation = f1(x1) = 7157.7 + 1.38349 (4000) = $12,691.66 (= s1 + s2 + s3 + s4)
Table 13.16 Optimum solution

13.4.12 Dynamic Programming in Inventory Model


In general, the analytical complexity of the inventory model depends on whether
demand is deterministic or probabilistic. In either category, the request may or may not vary
with time. For example, the consumption of natural gas used for heating homes is seasonal.
Although seasonal patterns repeat annually, consumption in the same month may vary from
year to year, depending, for example, on the severity of the weather. In practical situations, the
demand pattern in the inventory model can assume one of four types:
1. Deterministic and constant (static) with time.
2. Determinants and variables (dynamic) with time.
3. Probabilistic and stationary over time.
4. Probabilistic and non-stationary over time.

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.

13.5 Application of Computer Programming Applications to Solve Dynamic


Programming Problems
Problems in Dynamic Programming can be solved by using computer programming
software such as python, excel, lingo, etc. The function of this computer programming software
is to simplify and shorten the problem solving of Dynamic Programming. Not only that, the
use of computer programming software can also increase the accuracy of the results obtained.

13.5.1 Application of Excel in Dynamic Programming Problem Solving


The nature of DP computations makes it impossible to develop common computer code
that can handle all DP problems. Perhaps this explains the persistent absence of commercial
DP software. In this section, we present one of the forms of Excel based algorithm for dealing
with DP problem subclass: constraint knapsack problem single (excel file Integer Knapsack.xls
at: http://ipb.link/material-responsi-po). The algorithm is not data specific and can handle
problems where alternatives may assume values in the range 0 to 10.\

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

Figure 13.2 Stage 3

• Step 2.
f = max
2(x2) m2=0,1 {47m2 + f (x - 3 m )}
3 2 2

Figure 13.3 Stage 2

• Step 1
f = max
2(x2) m2=0,1,2 {31m + f (x - 2 m )}
1 2 1 1

Figure 13.4 Stage 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)

Figure 13.5 Example of problem solving

13.5.3 Application of Python in Dyanamic Programming Knapsack Problem Solving


It is known that there are three items weighing 10, 20, and 30. And their respective
values are 60, 100, and 120 respectively. The maximum capacity of goods that can be carried
is 50 and the choice is to only bring (1) or not bring (0) , also goods can not be carried half. In
addition, of course the goal is to maximize the value that can be obtained from the maximum
existing capacity.
As with other typical Dynamic Programming (DP) problems, recalculation of the same
subproblem can be avoided by bottom-up constructing a temporary K[][] array. The following
is an implementation based on Dynamic Programming. In Dynamic programming we will work
considering the same cases as mentioned in the recursive approach. In table DP[][] let's
consider all possible weights from '1' to 'W' as columns and weights that can be stored as rows.

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

13.5.4 Application of Python in Dynamic Programming Knapsack Problem Solving


In this section, we will explain the use of dynamic programming concepts in Lingo.
Lingo software itself is a simple software for linear and non-linear optimization that is used to
calculate many problems briefly, solve them, and analyse the problem. The example will solve
the shortest path problem that has been discussed previously. The display of the dynamic
programming model is as follows: (Lingo files can be downloaded at: http://ipb.link/material-
responsi-po)
• Problem :

Here is our primitive set of ten states, where


F( i) = the shortest path distance
from state i to the last state;
state: F;

! The derived set, MOVE, lists the moves that


exist between the states (note: not all state
pairs are directly linked by a road. Moves
are assumed to be one way.);
MOVE( state, state): D;
! D( i, j) is the distance from city i to j;

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;

! The following is the classic dynamic programming


recursion. In words, the shortest distance from
State i to State 10 is the minimum over all
state j reachable from i of the sum of the
distance from i to j plus the minimal distance
from j to City 10;
@FOR( state( i)| i #LT# STATESN:
F( i) = @MIN( MOVE( i, j): D( i, j) + F( j))
);
ENDSUBMODEL

• Solution (with Lingo)


CALC:
STATESN = @SIZE( STATE); ! Get index number of final state;
@SOLVE( DYNPROG); ! Do the Dynamic Programming;

! Write a simple report, showing best decision for each state...;


! Find an optimal decision for all states, except last;
@WRITE(' Dynamic Programming Solution', @NEWLINE(1));
@WRITE(' If in this state. Choose this state next', @NEWLINE(1));
@FOR( STATE( i) | i #LT# STATESN:
! Find next state for i on shortest route;
@FOR( MOVE( i,j) | F(i) #EQ# D(i,j) + F(j):
@WRITE( @FORMAT( STATE(i),'14s'),' ', @FORMAT( STATE(j), '15s'),
@NEWLINE(1));
);
);

@WRITE(@NEWLINE(1), " The Least Cost Path From State 1 is:",


@NEWLINE(1));
NEXT1 = -1;
START1 = 1;
@WHILE( NEXT1 #NE# STATESN:
@FOR( MOVE( i,j) | i #EQ# START1 #AND# F(i) #EQ# D(i,j) + F(j):

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

14.1 Game Theory


Different from other models that look at solving a problem using decision and objective
variables that think of one party, game theory is a technique used to solve problems related to
2 or more parties that have an intersecting focus. Examples are football games, and other
competitive sports or soft drink manufacturers' competition for the market. So, by definition,
game theory is a science that aims to find decisions when there are two or more rational parties
in a conflict or competition. In this case, the competitor is called the player. Several conditions
need to be met to show that a problem can be solved using Game theory:
1. There is a limited number of competitors referred to as players.
2. There are a number of possible steps each player can take
3. The game starts when the player chooses a step or action that is carried out
simultaneously with each other not knowing the other player's move.
4. All players act rationally.
5. Each player wants to maximize his profit or minimize his loss.
6. Each player takes a step without communicating between players.
7. It is assumed that each player has the relevant information.

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:

Table 14.1 Each player's choice

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).

14.3 The Concepts of Dominance in zero-sum Games


In games that have a large number of move options, it will be difficult to find
saddle points directly. For this reason, dominance can be done in order to reduce choices and
make the problem simple. In simple terms, the strategy of row i is said to dominate row j if all
pay-offs in row i are greater than or equal to row j. Column m is said to dominate column n if
all elements of column m are less than or equal to column n. The dominated column or row
will then be eliminated, making the matrix simpler. For example, it can be seen as follows:

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.

14.4 Case Without Saddle Point


In some cases of game theory zero-sum games, no saddle points were obtained after
domination, to solve this, we can use a formula that uses a template, namely:

So when tested on the question of dominance above, namely:

155
The mean value is 0.

Other examples are:

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:

There is no saddle point, with the middle value being:

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.

An example of a solution using the graphical method is as follows:

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

So it can be made into a graph as follows:

Figure 14.1 Result graph

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:

14.7 Understanding Concepts and Troubleshooting Game Theory Multiplayer (n-


person zero-sum game)
n- Person Zero-sum games or multiplayer games are whenever more than two people
are involved in the game, they are treated as if the two coalitions were formed by the n -
people involved. The nature of the game is the value of the various plays between each

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)

14.8 Applying Game Theory Concepts to Python and Lingo


14.8.1 Applying Game Theory Concepts to Python
14.8.1 Mengaplikasikan Konsep Game Theory pada Python
Game theory concepts can also be studied and applied to Python. Let's start with a
classic example: The Prisoner's Dilemma. For example, there are two prospective prisoners A
and B who will become players. They were both arrested and taken to the police station where
they were separated into different interrogation rooms. The detectives who interrogated the two
players didn't have enough evidence, they needed a confession. Here are the strategies and
rewards for both players:
• If one player confesses while the other remains silent, the player who confesses (or
complains) will be free while the other player serves 10 years.
• If both players comply with the code and remain silent, each player gets one year in
prison on a false charge.
• If both players pit each other, they each get nine years. (prosecutors were kind enough
to cut a year's sentence for cooperation).
Consider a silent strategy called "dove" and a pitting strategy called "hawk". Let's use
Python to create the Pay-off matrix of player A:
(Numpy, pandas and quantecon modules required; Python files can be downloaded at:
http://ipb.link/material-responsi-po)

163
Figure 14.2 Player A Pay-off Matrix in Python

Player A is represented by rows while B is represented by columns. For example, if A


plays dove while B plays hawk, A's reward is -10 (the number of years he has been in prison).
If A plays hawk and B plays dove, A's reward is 0 (no jail time).
Next let's create a Pay-off matrix B. To achieve this, we need to swap rows by columns
because the resulting matrix B is the transpose of A. This is very easy to do in Python:

Figure 14.3 Player B 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.

Then create the table in Python.

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:

Code 14.5 Pay-off function of players A and B in Python

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:

Figure 14.6 Results of the game with (hawk, hawk)

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.

If Gold chooses step (c), the expected losses are:


3 BMA - 4 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:

Figure 14.8 Solution of the LB equation

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:

Figure 14.9 Linear equation maximizing minimum profit Gold (PG)

With solution:

Figure 14.10 Solution of the PG . equation

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.

14.9 Example of Game Theory Implementation Case


One of the challenges in optimizing the supply chain of the sago agroindustry is how to
optimize the supply chain strategy. As is known, sago is a strategic and potential commodity
in Indonesia with Indonesian as the largest provider of sago resources in the world. In a study
conducted by Anwar S, Djatna T, Sukardi, and Suryadarma P (2021), a supply chain risks
(SCR) network model was developed and studied its impact on the performance of sago starch
agro-industry (SSA). The model used is Bayesian Network (BN) to analyze the SCR which has
the characteristics of uncertainty and interdependence. This study applies operating game
theory, which in its results, is how to optimize supply chain strategies which include the
mechanism for selecting optimal sago raw material sources from players, suppliers, and
distributors of the sago industry supply chain.

168
BIBLIOGRAPHY

[1] F. S. Hillier dan L. J. Gerald, Introduction to Operation Research, New York: McGraw-
Hill Education, 2015.

[2] M. L. Bynum, H. A. Gabriel, H. E. William, L. D. Carl, N. L. Bethany, S. D. John, W.


Jean-Paul dan W. L. David, Pyomo - Optimization Modelling in Python, 2021.

[3] LINDO, LINGO The Modelling Language and Optimizer, Chicago: Lindo System Inc,
2018.

[4] Ahuja, R. K, M. L. Thomas dan J. B, Network Flows Theory Algorithms and


Applications, New Jersey: Prentice-Hall Inc, 1993.

[5] Anderson, D. R, S. J. Dennis, W. A. Thomas, C. D. Jeffrey, C. J. James, F. J. Michael


dan O. A. Jeffrey, An Introduction to Management Science: Quantitative Approaches to
Decision Making, Boston: Cengage Learning Inc, 2019.

[6] E. Bressert, SciPy and Numply, O'Reily Media Inc, 2013.

[7] R. P. Murthy, Operation Research, Anantapur: New Age International Publisher, 2007.

[8] R. A. Ravindran, Operation Research Applications, Pennsylvania: Taylor & Francis


Group LLC, 2009.

[9] H. A. Taha, Operation Research An Introduction, Fayetteville: Pearson Education, 2017.

[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.

[12] T. Djatna dan G. A. Amien, “Bi-objective freight scheduling optimization in an integrated


forward/reverse logistic network using non-dominated sorting genetic algorithm-II,”
Decision Science Letters, vol. 9, no. 1, pp. 91-106, 2020.

[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

You might also like