END331 Lecturenotes Week1
END331 Lecturenotes Week1
Contact information
tekinermogulkoc@itu.edu.tr
ucyaman@itu.edu.tr
Course Information
Course Objective
This course aims to teach quantitative decision making, modeling
philosophy and model building and solution techniques for LP
problems.
Course Content
• The modeling concepts in production and management,
• Linear programming and Simplex algorithm,
• Big M and Two Phase Simplex Methods, Revised Simplex method,
• Duality and economic analysis,
• Transportation/Assignment/Transshipment models and their
solution methods,
• Introduction to network models
Software
• GAMS, Lindo, Excel Solver, OpenSolver for Excel
(https://opensolver.org/)
Ninova Page
All the course materials will be on Ninova page.
All the announcements will be made through Ninova page.
7
Week Date Topics
1 12.02.2024 Weekly Schedule
Introduction to OR, Introduction to LP, Modeling with LP, Basic
Terminology
2 19.02.2024 Modeling (LP formulation), Graphical Method,
3 26.02.2024 Software Packages(Lindo, GAMS, OpenSolver)
4 04.03.2024 Simplex Algorithm, Big M Method
5 11.03.2024 Two Phase Simplex
6 18.03.2024 Sensitivity Analysis (Utilizing graphical solution, utilizing
software output)
7 25.03.2024 Midterm Exam I
8 01.04.2024 Duality, Complementary Slackness and Dual Simplex
08.04.2024 Spring Break
9 15.04.2024 Revised Simplex
10 22.04.2024 Sensitivity Analysis (Utilizing revised simplex)
11 29.04.2024 Transportation Problem, Transportation Simplex
12 06.05.2024 Assignment and Transshipment Problems
13 13.05.2024 Introduction to network flows
14 20.05.2024 Midterm Exam II
Lectures
• 4 Assignments (25%)
• 2 Midterm Exams (35%)
• 1 Final Exam (40%)
You will get VF if you DO NOT satisfy the following two conditions:
- Get at least 30 points from one of the midterm exams
- Get at least 50 points from two of the assignments
If your final exam score is below 30 or your overall score is below 40; then
you will get FF.
Assignments
Assignment can be done in a group of three students. You can form different
groups for different assignments.
Make-up Exam
There will be only one make-up exam for midterm exam 1&2.
It will be given in the 14th week. All the topics are included in the
make-up exam.
Cheating and Plagiarism
• Do NOT do it!
• You will get FF if you cheat on the exams
• Text copied directly from one source (internet or book) will be
considered as a plagiarism.
• Groups cheated on assignments will be get -100 points for the
corresponding assignment.
FAQ
• Could we study in a group of four and submit one report for the assignment?
– No. You will get zero.
• Could we study in a group of four and submit two reports for two groups of two
people for the assignment?
– No. It will be treated as cheating and students will get -100.
• Could we add the name of a student whom we forgot the put his/her name on the
cover page of assignment report after submitting it?
– No. Make sure that you write the names of all students in the group.
• We have run out of time while we are submitting our assignment, could we send it
via email?
– No. Arrange your time accordingly.
• We share the questions among group members, but one of the group member do
not do its part. Is it possible to be evaluated based on only my part.
– It is your responsibility to manage the group. We advise you do all questions together. Parts of the
assignments submitted as a group will be evaluated.
Introduction to
Operation Research
What is Operation Research?
What is Operation Research?
What is Operation Research?
During World War II, British military leaders asked
scientists and mathematicians to analyze several
military problems, involving
• the deployment of radar
• the management of convoys, bombing,
antisubmarine, and mining operations.
What is Operation Research?
• The applications of mathematics and scientific
method to military operations was called
OPERATIONS RESEARCH.
• Today, operations research (or management
science) describes a scientific approach to
decision making for determining how best to
design and operate a system, usually under
resource limitations.
• OR helps operations managers make decisions when
problems are complex and wrong decisions are costly.
What is Operation Research?
The use of
OR
to solve an
organizational
problem
typically
follows a
seven-step
procedure
The Methodology of Operations Research
STEP 1.
Formulate the problem
• This step includes understanding and expressing
the organization’s objectives and identifying the
operations and parts of the system to be studied so
that the problem can be solved.
STEP 2.
Observe the system
• Data collection, estimation of relevant parameters.
The Methodology of Operations Research
STEP 3.
Formulate a mathematical model of the problem
• How the system and the problem under study can be
represented?
• The relations between parameters of the system.
• If an analytical model is difficult to formulate, a simulation
model can be developed to approximate the behavior of
the actual system.
The Methodology of Operations Research
STEP 4.
Verify the model and use it for prediction
• Test to determine if the model provides a good
representation of reality.
• To determine how well the model fits reality, one
determines how valid the model is for the current
situation.
• This may require more observations and data collection.
The Methodology of Operations Research
STEP 5.
Select a suitable alternative
• For the given model there may be several alternative
solutions.
• This step evaluates and chooses the best alternative that
meets the objectives defined in STEP 1.
• Sometimes the set of alternatives is subject to certain
restrictions and constraints. In many situations, the best
alternative may be impossible or too costly to determine.
The Methodology of Operations Research
STEP 6.
Present the results and conclusions to the
management
• The model, alternative solutions and recommendations are presented
to the decision makers.
• One might present several alternatives and let the organization
choose the decision maker(s) choose the one that best meets
her/his/their needs.
• After presenting the results of the OR study to the decision maker(s),
the analyst may find that s/he does not (or they do not) approve of
the recommendations. This may result from incorrect definition of the
problem on hand or from failure to involve decision maker(s) from the
start of the project. In this case, the analyst should return to Step 1,
2, or 3.
The Methodology of Operations Research
STEP 7.
Implement and evaluate the recommendations
• If the study is accepted, the implementation step begins.
• The system is monitored to ensure that the objectives are
realized and (and updated dynamically as the environment
changes.
• There may be returns to previous steps in this procedure.
The Methodology of Operations Research
Successful applications of operations research can
result in huge savings.
The literature is full of real-life examples, including:
• Reducing costs for energy production, inventory and shortage.
• Designing an optimal molding facility for steel production.
• Selecting the best blending combination for refineries.
• Scheduling trucks for a delivery company.
• Inventory management.
• Optimal equipment replacement scheduling.
• Optimal location of an airport.
HISTORY OF OR
OR is a relatively new discipline. Whereas 70 years ago it would have been
possible to study mathematics, physics or engineering (for example) at
university it would not have been possible to study OR, indeed the term OR
did not exist then. It was only really in the late 1930's that operational
research began in a systematic fashion, and it started in the UK.
Early in 1936 the British Air Ministry established Bawdsey Research Station,
on the east coast, near Felixstowe, Suffolk, as the centre where all pre-war
radar experiments for both the Air Force and the Army would be carried
out. Experimental radar equipment was brought up to a high state of
reliability and ranges of over 100 miles on aircraft were obtained.
It was also in 1936 that Royal Air Force (RAF) Fighter Command, charged
specifically with the air defense of Britain, was first created. It lacked
however any effective fighter aircraft - no Hurricanes or Spitfires had come
into service - and no radar data was yet fed into its very elementary warning
and control system.
HISTORY OF OR
It had become clear that radar would create a whole new series of problems
in fighter direction and control so in late 1936 some experiments started at
Biggin Hill in Kent into the effective use of such data. This early work,
attempting to integrate radar data with ground based observer data for
fighter interception, was the start of OR.
The first of three major pre-war air-defense exercises was carried out in the
summer of 1937. The experimental radar station at Bawdsey Research
Station was brought into operation and the information derived from it was
fed into the general air-defense warning and control system. From the early
warning point of view this exercise was encouraging, but the tracking
information obtained from radar, after filtering and transmission through
the control and display network, was not very satisfactory.
HISTORY OF OR
In July 1938 a second major air-defense exercise was carried out. Four additional
radar stations had been installed along the coast and it was hoped that Britain now
had an aircraft location and control system greatly improved both in coverage and
effectiveness. Not so! The exercise revealed, rather, that a new and serious problem
had arisen. This was the need to coordinate and correlate the additional, and often
conflicting, information received from the additional radar stations. With the out-
break of war apparently imminent, it was obvious that something new - drastic if
necessary - had to be attempted. Some new approach was needed.
On May 15th 1940, with German forces advancing rapidly in France, Stanmore
Research Section was asked to analyze a French request for ten additional fighter
squadrons (12 aircraft a squadron) when losses were running at some three
squadrons every two days. They prepared graphs for Winston Churchill (the British
Prime Minister of the time), based upon a study of current daily losses and
replacement rates, indicating how rapidly such a move would deplete fighter
strength. No aircraft were sent and most of those currently in France were recalled.
HISTORY OF OR
This is held by some to be the most strategic contribution to the course of the war
made by OR (as the aircraft and pilots saved were consequently available for the
successful air defense of Britain, the Battle of Britain).
These early OR workers came from many different disciplines, one group consisted
of a physicist, two physiologists, two mathematical physicists and a surveyor. What
such people brought to their work were "scientifically trained" minds, used to
querying assumptions, logic, exploring hypotheses, devising experiments, collecting
data, analyzing numbers, etc. Many too were of high intellectual caliber (at least
four wartime OR personnel were later to win Nobel prizes when they returned to
their peacetime disciplines).
HISTORY OF OR
By the end of the war OR was well established in the armed services both in the UK
and in the USA.
OR started just before World War II in Britain with the establishment of teams of
scientists to study the strategic and tactical problems involved in military operations.
The objective was to find the most effective utilization of limited military resources
by the use of quantitative techniques.
Following the end of the war OR spread, although it spread in different ways in the
UK and USA.
You should be clear that the growth of OR since it began (and especially in the last 3
years) is, to a large extent, the result of the increasing power and widespread
availability of computers. Most (though not all) OR involves carrying out a large
number of numeric calculations. Without computers this would simply not be
possible.
HISTORY OF OR
In Turkiye, the OR studies are started in 1956. A group called “Harekat Araştırması” is
formed in the General Staff by the help of Alb. Fuat Uluğ. Research was conducted
on mobilization and air defense issues with support from abroad.
The first OR course in Turkiye was given at ITU Mechanical Engineering Faculty in
1960-61 by Prof. Dr. İlhami Karayalçın.
• If one or more of the decision variables must be integer, then we say that
an optimization model is an integer model.
• If all the decision variables are free to assume fractional values, then an
optimization model is a noninteger model.
• Integer models are much harder to solve then noninteger models.
OR Tools
An optimization model seeks to find values of the decision variables that optimize
(maximize or minimize) an objective function among the set of all values for the
decision variables that satisfy the given constraints.
Basic Concepts
Two Mines Example
The Two Mines Company own two different mines that produce an ore which,
after being crushed, is graded into three classes: high, medium and low-
grade. The company has contracted to provide a smelting plant with 12 tons
of high-grade, 8 tons of medium-grade and 24 tons of low-grade ore per
week. The two mines have different operating characteristics as detailed
below.
Consider that mines cannot be operated in the weekend. How many days per
week should each mine be operated to fulfill the smelting plant contract?
Basic Concepts
Guessing
To explore the Two Mines problem further we might simply guess (i.e. use our
judgment) how many days per week to work and see how they turn out.
• work one day a week on X, one day a week on Y
This does not seem like a good guess as it results in only 7 tons a day of high-
grade, insufficient to meet the contract requirement for 12 tons of high-grade
a week. We say that such a solution is infeasible.
Basic Concepts
Guessing
• work 4 days a week on X, 3 days a week on Y
This seems like a better guess as it results in sufficient ore to meet the
contract. We say that such a solution is feasible. However it is quite
expensive (costly).
We would like a solution which supplies what is necessary under the contract
at minimum cost. Logically such a minimum cost solution to this decision
problem must exist. However even if we keep guessing we can never be sure
whether we have found this minimum cost solution or not. Fortunately our
structured approach will enable us to find the minimum cost solution.
Basic Concepts
Solution
What we have is a verbal description of the Two Mines problem. What we
need to do is to translate that verbal description into an equivalent
mathematical description.
In dealing with problems of this kind we often do best to consider them in the
order:
• Variables
• Constraints
• Objective
This process is often called formulating the problem (or more strictly
formulating a mathematical representation of the problem).
Basic Concepts
Variables
These represent the "decisions that have to be made" or the "unknowns".
ore production constraints - balance the amount produced with the quantity
required under the smelting plant contract
Basic Concepts
Constraints
It is best to first put each constraint into words and then express it in a
mathematical form.
ore production constraints - balance the amount produced with the quantity
required under the smelting plant contract
Ore-High 6x + 1y ≥ 12
Ore-Medium 3x + 1y ≥ 8
Ore-Low 4x + 6y ≥ 24
Basic Concepts
Constraints
It is best to first put each constraint into words and then express it in a
mathematical form.
ore production constraints - balance the amount produced with the quantity
required under the smelting plant contract
Ore-High 6x + 1y ≥ 12
Ore-Medium 3x + 1y ≥ 8
Ore-Low 4x + 6y ≥ 24
Inequality constraints
Note we have an inequality here rather than an equality. This implies that we
may produce more of some grade of ore than we need. In fact we have the
general rule: given a choice between an equality and an inequality choose the
inequality. The reason for this general rule is that choosing an inequality
rather than an equality gives us more flexibility in optimizing (maximizing or
minimizing) the objective (deciding values for the decision variables that
optimize the objective).
Basic Concepts
Constraints
It is best to first put each constraint into words and then express it in a
mathematical form.
ore production constraints - balance the amount produced with the quantity
required under the smelting plant contract
Ore-High 6x + 1y ≥ 12
Ore-Medium 3x + 1y ≥ 8
Ore-Low 4x + 6y ≥ 24
days per week constraint - we cannot work more than a certain maximum
number of days a week e.g. for a 5 day week we have
x≤5
y≤5
Implicit constraints
Constraints such as days per week constraint are often called implicit
constraints because they are implicit in the definition of the variables.
Basic Concepts
Objective
Again in words our objective is (presumably) to minimize cost which is given
by
180x + 160y
How much of each paint should be produced to maximize the total daily profit?
Elements of an LP Model
1. Decision variables (to be determined)
2. Objective function (to be optimized)
(Maximize revenue or profit, minimize cost, distance, loss etc.)
Maximize z = 5 x1 + 4 x2 (1)
Subject to 6 x1 + 4 x2 £ 24 (2) Technological coefficients
(Coefficients of decision
x1 + 2 x2 £ 6 (3)
variables in the constraints)
Raw material
constraints - x1 + x2 £ 1 (4)
x2 £ 2 (5)
Right hand side (rhs)
Demand constraints x1 , x2 ³ 0 (6)
Elements of an LP Model
DEFINITION 1
• Any solution that satisfies all these constraints is a FEASIBLE SOLUTION.
1. Proportionality
• The contribution of each decision variable in both the
objective function and the constraints is directly
proportional to the value of the variable.
(In case of quantity discounts, that will be violated, since
the profits will change after a certain limit on decision
variables).
Assumptions for the Linear Model
2. Additivity
• The total contribution of all the variables in the objective
function and in the constraints is the direct sum of individual
contribution of each variable.
• That means, for example in Example 1, no matter what the
value of x2 is, the production of x1 will always contribute 5x1
to the objective function.
(Two competing products will violate this, since if one is sold
more, the other will be sold less).
• A similar argument holds for constraints.
Assumptions for the Linear Model
For an LP to be an appropriate representation of real-life
situation, two more assumptions are needed:
3. Divisibility
• Decision variables can assume fractional values, i.e.
values like x1 = 3.2 or x2 = 1.75 are possible.
• If x1, x2, … xn must be nonnegative integers (no divisibility)
then we will have an INTEGER PROGRAMMING problem.
• If divisibility is not present but the solution includes
fractional values, rounding them to an appropriate integer
may yield a reasonable solution.
Assumptions for the Linear Model
4. Certainty
• Each parameter of the LP (objective function
coefficients, right hand sides, and technology
coefficients) is known with certainty.
Linear Programming Examples
Giapetto produces wooden soldiers and trains. Each soldier sells for $27, uses
$10 of raw materials and takes $14 of labor & overhead costs. Each train sells
for $21, uses $9 of raw materials, and takes $10 of overhead costs. Each
soldier needs 2 hours finishing and 1 hour carpentry; each train needs 1 hour
finishing and 1 hour carpentry. Raw materials are unlimited, but only 100
hours of finishing and 80 hours of carpentry are available each week. Demand
for trains is unlimited; but at most 40 soldiers can be sold each week. How
many of each toy should be made each week to maximize profits?
Linear Programming Examples
Answer
Decision variables completely describe the decisions to be made (in this case, by
Giapetto). Giapetto must decide how many soldiers and trains should be
manufactured each week. With this in mind, we define:
x1 = the number of soldiers produced per week
x2 = the number of trains produced per week
Objective function is the function of the decision variables that the decision
maker wants to maximize (revenue or profit) or minimize (costs). Giapetto can
concentrate on maximizing the total weekly profit (z).
Here profit equals to (weekly revenues) – (raw material purchase cost) – (other
variable costs). Hence Giapetto’s objective function is:
Maximize z = 3x1 + 2x2
Linear Programming Examples
Constraints show the restrictions on the values of the decision variables.
Without constraints Giapetto could make a large profit by choosing decision
variables to be very large. Here there are three constraints:
• Finishing time per week
• Carpentry time per week
• Weekly demand for soldiers
Sign restrictions are added if the decision variables can only assume
nonnegative values (Giapetto can not manufacture negative number of
soldiers or trains!)
Linear Programming Examples
All these characteristics explored above give the following Linear
Programming (LP) model
A value of (x1, x2) is in the feasible region if it satisfies all the constraints and
sign restrictions. Graphically and computationally we see the solution is (x1,
x2) = (20, 60) at which z = 180. (Optimal solution)
Report
The maximum profit is $180 by making 20 soldiers and 60 trains each week.
Profit is limited by the carpentry and finishing labor available. Profit could be
increased by buying more labor.
Linear Programming Examples
Advertisement Example
Dorian makes luxury cars and jeeps for high-income men and women. It
wishes to advertise with 1 minute spots in comedy shows and football games.
Each comedy spot costs $50K and is seen by 7M high-income women and 2M
high-income men. Each football spot costs $100K and is seen by 2M high-
income women and 12M high-income men. How can Dorian reach 28M high-
income women and 24M high-income men at the least cost?
Linear Programming Examples
Answer
The decision variables are
x1 = the number of comedy spots
x2 = the number of football spots
The model of the problem:
min z = 50x1 + 100x2
s.t. 7x1 + 2x2≥ 28
2x1 + 12x2 ≥24
x1, x2≥0
The graphical solution is z = 320 when (x1, x2) = (3.6, 1.4). From the graph, in
this problem rounding up to (x1, x2) = (4, 2) gives the best integer solution.
Report
The minimum cost of reaching the target audience is $400K, with 4 comedy
spots and 2 football slots. The model is dubious as it does not allow for
saturation after repeated viewings.
Linear Programming Examples
Diet Example
Ms. Fidan’s diet requires that all the food she eats come from one of the four
“basic food groups“. At present, the following four foods are available for
consumption: brownies, chocolate ice cream, cola, and pineapple
cheesecake. Each brownie costs 0.5$, each scoop of chocolate ice cream costs
0.2$, each bottle of cola costs 0.3$, and each pineapple cheesecake costs
0.8$. Each day, she must ingest at least 500 calories, 6 oz of chocolate, 10 oz
of sugar, and 8 oz of fat. The nutritional content per unit of each food is
shown in Table. Formulate an LP model that can be used to satisfy her daily
nutritional requirements at minimum cost.
Linear Programming Examples
Answer
The decision variables:
x1: number of brownies eaten daily
x2: number of scoops of chocolate ice cream eaten daily
x3: bottles of cola drunk daily
x4: pieces of pineapple cheesecake eaten daily
The objective function (the total cost of the diet in cents):
min w = 50x1 + 20x2 + 30x3 + 80x4
s.t.
400 x1 + 200 x2 + 150 x3 + 500 x4 ≥ 500 (daily calorie intake)
3 x1 + 2 x2 ≥ 6 (daily chocolate intake)
2 x1 + 2 x2 + 4 x3 + 4 x4 ≥ 10 (daily sugar intake)
2 x1 + 4 x2 + x3 + 5 x4 ≥ 8 (daily fat intake)
xi ≥ 0, i = 1, 2, 3, 4 (Sign restrictions!)
Report
The minimum cost diet incurs a daily cost of 90 cents by eating 3 scoops of
chocolate and drinking 1 bottle of cola (w = 90, x2 = 3, x3 = 1)
Linear Programming Examples
Post Office Example
A PO requires different numbers of employees on different days of the week.
Union rules state each employee must work 5 consecutive days and then
receive two days off. Find the minimum number of employees needed.
Linear Programming Examples
Answer
The decision variables are xt (# of employees starting on day t)
Mathematically we must
min z = x1 +x2 +x3 +x4 +x5 +x6 +x7
x1 +x4 +x5 +x6 +x7 ≥ 17
x1 +x2 +x5 +x6 +x7 ≥ 13
x1 +x2 +x3 +x6 +x7 ≥ 15
x1 +x2 +x3 +x4 +x7 ≥ 19
x1 +x2 +x3 +x4 +x5 ≥ 14
+x2 +x3 +x4 +x5 +x6 ≥ 16
+x3 +x4 +x5 +x6 +x7 ≥ 11
xt≥0, t
Linear Programming Examples
Rapor
The solution is (xt) = (4/3, 10/3, 2, 22/3, 0, 10/3, 5) giving z = 67/3.