Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 37

Name: Ziaullah Jan

Semester: 5th
REG: 18PWIND541
Section: A
All lab reports
Subject: Operations Research (LAB)
Submitted to: Sir Usman Qazi
Department of Industrial Engineering
Lab: 01

Title: Introduction to Operation Research Lab and Software.


Introduction

Operations research (OR) is an analytical method of Problem-solving and decision-making that


is useful in the management of organizations. In operations research, problems are broken down
into basic components and then solved in defined steps by mathematical analysis. Operations
research is a quantitative approach that solves problems, using a number of mathematical
techniques. It is helpful to use operations research when one is trying to make decisions but the
conditions are uncertain, and when differing objectives are in conflict with each other.

Objectives

 To understand the meaning, purpose of Operation Research.


 To Know and use different SOFTWARES.

Different SOFTWARES used in Operation Research.

LINGO

It is a programming Language, It is a software tool designed to efficiently build and solve linear,
nonlinear, and integer optimization models. The main purpose of LINGO is to allow a user to
quickly input a model formulation, solve it, assess the correctness or appropriateness of the
formulation based on the solution, quickly make minor modifications to the formulation, and
repeat the process. LINGO features a wide range of commands, any of which should be invoked
at any time. LINGO checks whether a particular command makes sense in a particular context

TORA

Temporary-Ordered Routing Algorithm (TORA) is an Operations Research Software TORA is


an algorithm i.e. a mathematical set of instructions or programs (mathematical-software). It is an
optimization system in the area of operations Research which is very easy to use. Further, TORA
is menu-driven and Windows-based which makes it very user friendly. The software can be
executed in automated or tutorial mode. The automated mode reports the final solution of the
problem, usually in the standard format followed in commercial packages, while the tutorial
mode keeps on giving step-wise information about the methodology and solution. The software
has in-built tutorial for the novice and it also produces animated graphical linear programming
solution. The other features of the software include dynamic construction of Critical Path
Method charts and creation of search-trees to name some.
AMPL

AMPL is a comprehensive and powerful algebraic modeling language for linear and nonlinear
optimization problems, in discrete or continuous variables. AMPL lets you use common notation
and familiar concepts to formulate optimization models and examine solutions, while the
computer manages communication with an appropriate solver. AMPL’s flexibility and
convenience render it ideal for rapid prototyping and model development, while its speed and
control options make it an especially efficient choice for repeated production runs. AMPL is
notable for the similarity of its arithmetic expressions to customary algebraic notation, and for
the generality and power of its set and subscripting xviii INTRODUCTION expressions. AMPL
also extends algebraic notation to express common mathematical programming structures such
as network flow constraints and piecewise linarites.

EXCEL

Microsoft Excel is a spreadsheet program that is used to record and analyze numerical data.
Think of a spreadsheet as a collection of columns and rows that form a table. Alphabetical letters
are usually assigned to columns and numbers are usually assigned to rows. The point where a
column and a row meet is called a cell. The address of a cell is given by the letter representing
the column and the number representing a row.

Conclusions

Operation Research holds paramount importance since the fact that mostly industrial related
problems are solved through linear programming which is the branch of OR. This lab report
deals with software, which helps us in solving different complex and simple problems which we
encounter in industrial field. In terms of software. Microsoft excel is a powerful spreadsheet
program used to record, manipulate, store numeric data and it can be customized to match your
preferences similarly TORA, LINGO etc. are really interesting and important.
Lab: 02

Title: Solving the Reddy Mikks and Diet Problems on LINGO


Objectives

 To manually operate LINGO on Computer.


 To be able to solve different LP problems using LINGO.
 To be able to draw conclusions from the obtained results.

Methodology

The basic General Procedure in order to initiate TORA is to click on the application’s icon on the
desktop, after the TORA has been clicked this screen pops up which asks for the sort of problem
we want to solve in this case I will select the LP option cause our problem is related to it.
Therefore, as the software runs, this Figure 1 comes up, it asks for basic information related to
the problem such as the Decimal points etc.

Problem #1

Reddy Mikks produces both interior and exterior paints from two raw material M1, M2. The
following table provides the basic data of problem. A market survey indicates that the daily
demand for interior paint cannot exceed that for exterior paint more than 1 ton. Also, the
maximum daily demand for interior paint is 2 tons. Reddy Mikks wants to determine the
optimum product mix of interior and exterior paints that maximizes the total daily profit.

Solution

LAB NUMBER #3

Solving the Reddy Mikks and Diet Problems on LINGO

Introduction LINGO is a software program used for solving simultaneous linear and nonlinear
equations and inequalities. LINGO may be called linear programming, integer programming,
quadratic programming, nonlinear programming, or nonlinear optimization. The main purpose of
LINGO is to allow a user to quickly input a model formulation, solve it, assess the correctness or
appropriateness of the formulation based on the solution, quickly make minor modifications to
the formulation, and repeat the process. LINGO features a wide range of commands, any of
which may be invoked at any time. LINGO checks whether a particular command makes sense
in a particular context

Objectives

 To manually operate LINGO on Computer.


 To be able to solve different LP problems using LINGO.
 To be able to draw conclusions from the obtained results.

Methodology

The basic General Procedure inorder to initate LINGO is to click on the application’s icon on the
desktop, after the LINGO has been clicked this white screen pops up if theres already some sort
of program,or problem written there just simply go to the file option at the top and select new
page option.There are two problems that we basically did on LINGO. It is fairly easy software to
work on and solve different problem.

Problem#1
Ozark farms uses at least 800 lb of special feed daily. The special feed is mixture of corn and
soybean meal with the following composition:

The dietary requirements of the special feed are at least 30% protein and at most 5% fiber. Ozark
farms wishes to determine the daily minimum-cost feed mix.

Decision variables:
x1 = Tons produced daily of exterior paint
x2 = Tons produced daily of interior paint
Variable types:
x1 ≥ 0 [Nonnegative reals]
x2 ≥ 0 [Nonnegative reals]

Objective function:

Maximize z = 5x1 + 4x2 [The total profit]

Constraints
a. 6x1 + 4x2 ≤ 24 [Raw material M1]
b. x1 + 2x2 ≤ 6 [Raw material M2]
c. x2 − x1 ≤ 1 [Market limit]
d. x2 ≤ 2 [Demand limit]

Obtaining graphical solution in TORA

i. First open the TORA window and select Linear Programming option as illustrated in
Fig 2.1

Figure 2.1 Window of TORA

ii. Select the “enter new problem option” to start and adjust the number of numerals and
decimals required as shown in Fig 2.2

Figure 2.2 Input Mode and Input Format

iii. Enter problem title, constraints and number of variables in TORA as shown in Fig2.3
Figure 2.3 Entering Initial Information in TORA

iv. Enter values of the constraints, variables and inequalities in TORA as shown in
Fig2.4

Figure 2.4 Data Entry

v. After entering all the data, click SOLVE menu icon which would open another
screen, choose graphical mode as shown in Fig2.5. This would lead to another screen
showing a graph of first quadrant in grid mode depicted in Fig 2.6

Figure 2.5 Solve Menu Icon


Figure 2.6 Graph Showing First Quadrant

vi. Click the entire constraints one by one which would limit the graph to the feasible
region simultaneously.
vii. After this, click the maximization equation which would show the optimum solution
in the graph. Optimal solution can be seen in the lower left corner of the screen. This
procedure is shown in Fig2.7
Figure 2.7 Graphical Solution

Results and Discussion

Reddy Mikks should produce 3 tons of interior paints and 1.5 tons of exterior paints, which gives
a maximum total profit of $21 000. This is the only optimal solution.
Lab:04
Title: Solve Urban Planning problem on LINGO and TORA
Introduction
This lab deals with solving two problems on TORA and LINGO. The first problem is related to
investment. Today’s investors are presented with multitudes of investment opportunities.
Example of one of such problems is bank loan policy. In this situation, linear programming can
be used to select the optimal mix of opportunities that will maximize return while meeting the
investment conditions set by the investor.
The second problem is related to production planning and inventory control. This problem deals
with the use of inventory in a multi period production system to fill future demand.

Objectives

 To solve loan policy model on TORA and LINGO.


 To solve multi period production model on TORA and LINGO.
 To understand the results generated through these softwares.

Problem Statement No. 1


Thriftem Bank, is in the process of formulating a loan policy involving a total of $12 million.
Being a full-service faculty, the bank is obligated to grant loans to different clientele. The
following table 1 provides the types of loans:
Table 1

Type of loan Interest Probability of


Rate bad debt
Personal 0.140 0.10
Car 0.130 0.07
Home 0.120 0.03
Farm 0.125 0.05
Commercial 0.100 0.02

Bad debts are assumed unrecoverable and hence produce no interest revenue.

Competition with other financial institutions in area requires that the bank allocate at least 40%
of the total funds to farm and commercial loans. To assist the housing industry in the region,
home loans must equal at least 50% of the personal, car, and home loans. The bank also has a
stated policy specifying that the overall ratio for bad debts on all loans may not exceed 4%.

Procedure for Solution


Decision variables:
X 1= personal loans
X 2=car loans
X 3=homeloans
X 4=farm loans
X 5=commercial

Objective function:

Max z=0.026 x 1+0.0509 x 2+0.0864 x 3+0.06875 x 4+ 0.078 x 5

Constraints:
x 1+ x 2+ x 3+ x 4+ x 5≤12
0.4 x 1+ 0.4 x 2+0.4 x 3 – 0.6 x 4 – 0.6 x 5≤0
0.5 x 1+0.5 x 2 – 0.5 x 3≤0
0.06 x 1+ 0.03 x 2 – 0.01 x 3+0.01 x 4 – 0.02 x 5≤0

Obtaining Solution in LINGO

1. When starting LINGO for Windows, the program opens an <untitled> window. Enter the
objective function and constraints like this:
MAX =0.026*x1 + 0.0509*x2 + 0.0864*x3 + 0.06875*x4 + 0.078*x5;
X1 + x2 + x3 + x4 + x5 <= 12
0.4*x1 + 0.4*x2 + 0.4*x3 – 0.6*x4 – 0.6*x5 <= 0
0.5*x1 + 0.5*x2 – 0.5*x3 <=0
0.06*x1 + 0.03*x2 – 0.01*x3 + 0.01*x4 – 0.02*x5 <= 0
END
:
Note that there are two functions used here i.e. MAX/MIN and END. Also semicolon (;)
terminates a command.

2. Click on the Solve/“bullseye” button, use the Solve command from the Solve menu, or press
Ctrl+U to solve the model. While solving, LINGO will show the Solver Status Window with
information about the model and the solution process. When it’s done solving, the “State”
field should read “Global Optimum”. Then, click on the “Close” button to close the Solver
Status Window. This is shown in figure 4.1.
Figure 4.1 Solution Report for Loan Policy Problem

3. Editing the model is simply a matter of finding and changing the variable, coefficient, or
direction that is to be changed. Any changes will be taken into account the next time the
model is solved. Click on the button, use the Save command from the File menu, or press
Ctrl+S to save your work.

Obtaining Solution in TORA

1. Enter problem title, constraints and number of variables in TORA as shown in Figure 4.2.

Figure 4.2 Entering Initial Information in TORA

2. Enter values of the constraints, variables and inequalities in TORA as shown in Figure4.3.
Figure 4.3 Entering Data

3. After entering all the data, click SOLVE menu icon which would open another screen. Since
graphical solution is not possible for this problem, click on the algebraic solution. This would
lead to another screen showing a comprehensive solution report. This is shown in figure 4.4.

Figure 4.4 Solution Report in TORA


Results and discussion:

Solution report obtained through TORA and LINGO shows that it took two iterations to solve
the problem. The optimal solution calls for allocating all $12 million: $7.2 million to home loans
and $4.8 million to commercial loans. The remaining categories receive none. The return on the
investment is .08034.
Conclusion:

The graphical solution method can only be applied to LP problems with two variables. For
problems that are larger than this, computers are relied upon to provide solutions. A variety of
programs have been written to solve linear programming problems. This report discussed the
output that a computer program called LINGO gives when it solves a linear program. Small
linear programs can also be solved with a spreadsheet, such as Excel. For larger linear
programming problems, a more specialized program, like LINGO is needed. This report
discussed setting up, solving, and interpreting LP problems with TORA and LINGO.
As discussed earlier, the solution to an LP problem is a set of optimal values for each of the
variables. However, the output that comes with the solution to a LP problem usually contains
much more information than just this. In addition to the optimal values of the variables, the
output will typically include reduced cost values, slack or surplus values, and dual prices.
Lab: 05
Title: Solving gasoline bending and Crude oil refining problem on
Tora and Lingo
Introduction
A number of linear programming deals with blending different input materials to produce
products that meet certain specifications while minimizing the cost or maximizing the profit. The
input materials can be ores, metal scrapes, chemicals or crude oils and the output products could
be metal ingots, paints, or gasoline of various grades. The final products must satisfy certain
quality specifications. One goal of the model is determining the optimal mix of final products
that will maximize an appropriate profit function. In some cases, the goal may be to minimize a
cost function. This lab deals with the study and practice of solving problems especially blending
problem on different optimization software’s like TORA, LINGO.

Problem statement
Shale Oil, located on the island of Aruba, has a capacity of 1,500,000 bbl of crude oil per day.
The final products from the refinery include three types of unleaded gasoline with different
octane numbers (ON): regular with ON = 87, premium with ON = 89, and super with ON = 92.
The refining process encompasses three stages: (1) a distillation tower that produces feedstock
1ON = 822 at the rate of .2 bbl per bbl of crude oil, (2) a cracker unit that produces gasoline
stock 1ON = 982 by using a portion of the feedstock produced from the distillation tower at the
rate of .5 bbl per bbl of feedstock, and (3) a blender unit that blends the gasoline stock from the
cracker unit and the feedstock from the distillation tower. The company estimates the net profit
per barrel of the three types of gasoline to be $6.70, $7.20, and $8.10, respectively. The input
capacity of the cracker unit is 200,000 bbl of feedstock a day. The demand limits for regular,
premium, and super gasoline are 50,000, 30,000, and 40,000 bbl, respectively, per day. Develop
a model for determining the optimum production schedule for the refinery.

Figure 1 Product flow in the refinery problem


LP Model
In Linear programming model we will identify three things
a. Decision variables
b. Objective function
c. Constraints
Decision variables
Daily productionof regular gasoline=x 11+ x 21 bbl/day
Daily production of premium gasoline=x 12+ x 22bbl /day
Daily production of super gasoline=x 13+ x 23 bbl/day

Objective function
Maximize z=6.70 ( x 11 + x 21 ) +7.20 ( x12 + x 22) + 8.10(x 13+ x 23)

Constraints

Now we will find the solution with the help of TORA and LINGO

Solving with TORA


Procedure for solving this problem with TORA is:

1. Open TORA and select Linear programming.


2. A window will open where we have to type the problem name no. of variables and
constraints.
3. Then in the table we have to put the data.
Figure 2 Problem title and table

4. Click on the SOLVE menu and if we want to save data we can save it.
5. Then select solve problem through algebraic and from there we can select any method.
We will go for M method.

Figure 3 Solution from TORA

Objective value: 875000.0


Solving with LINGO
Procedure for solving this problem with LINGO is
1. First open the LINGO tool where a white interface will appear. This is the window where
we will type our commands.

Figure 4 Command window

2. Then write the objective function followed by the constraints.


3. When commands are finished type end which will turn blue.
4. Don’t forget to put a * between the variable and the co-efficient.
5. End every line with semi-colon.
6. Click on the solve option in the tool bar to get the result.
7. Figure 6 shows the solution of this LP model in LINGO.
Figure 5 Data entry in LINGO

Figure 6 Result in LINGO

Objective value: 875000.0


Conclusion
From lab we can conclude that we can solve linear programming model with the help of TORA
and LINGO. Both will give us the same solution. Both of them gives us the detailed solution.

Lab: 06

Title: Solving the single period production problem model on solver.


Introduction

This Lab report deals with solution of Single Period Production Model on Excel Solver, In this
problem in addition to the actual decision variable there are four slack variables as well. The
concept of using slack variable is important for single or Multiple Period Production system.

Objectives

The Following are the objectives of this lab

1. To Familiar with Excel Solver


2. To Understand and solve any problem on Excel solver
3. To be able to solve Single Period Production problem on Solver
4. To be able to use Slack Variables on Excel Solver

Problem statement

The Clothing Company that is manufacturing Parka and rest of the good mentioned in the table
in four departments, the company has received firm orders for its products. It also stipulates a
penalty for Undelivered Items. The following table is the data, we are supposed to devise an
optimal production plan for the company.

Departmen Parka Goose Pants Gloves Capacity

Cutting .30 .30 .25 .15 1000

Insulating .25 .35 .30 .10 1000

Sewing .45 .50 .40 .22 1000


Packaging .15 .15 .1 .05 1000

Demand 800 750 600 500

Unit Profit 30$ 40$ 20$ 10$

Unit 15$ 20$ 10$ 8$

Penalty

Formulation
In operation research, all types of problems are modeled following four steps. These are:
1. Decision variables
2. Objective function
3. Constraints
4. Solution

Steps mentioned above provides the agenda of how to solve a problem in operation research.
These steps are followed one after the other to get the solution of the problem. They are clearly
showed below. After specifying and completing these steps, the procedure section will show how
to use software Excel and get its services to approach the solution.

Decision Variables.

X1= Number of Parka clothes.

X2= Number of Goose Clothes.

X3=Number of Pants Clothes.

X4= Number of Gloves Clothes.

Si= Number of Slack Variables where i=1,2,3,4

Objective Function:
Max Z= 30x1+40x2+20x3+10x4-(15s1+20s2+10s3+8s4)

Constraints:

1. .30x1+.30x2+.25x3+.15x4<= 1000
2. .25x1+.35x2+.30x3+.10x4<=1000
3. .45x1+.50x2+.40x3+.22x<=1000
4. .15x1+.15x2+.10x3+.05x<= 1000
5. x1 + s1 = 500
6. x2 + s2= 750
7. x3+ s3= 600
8. x4+ s4= 800

Procedure:

In Excel solver, we firstly make sure that the Excel software has the Solver option, if for
example its not there, we add the option by going through the settings.After that we do the
following steps.

1. We firstly we make a table as shown in the figure.


2. We enter the constaints and Variables.
3. Once the Variables are entered we link the Variables with the constraints.
4. We the go for the Solver.
5. We add all the constraints, and the objective function in the table.
6. After that we make sure that solution, Sensitivity Analysis are checked.

Figure 7 Data entered in the table for solver


Results:
The Optimum solution is Z= $62000, x1=500, x2=750, x3=600 and x4=500 and the solution
satisfies all the demand for both types of jackets and gloves , there is no shortage and hence there
will be no penalty for them.

Lab No. 07
Solving the transportation Problem on TORA.

Introduction
This lab deals with solving two transportation models on TORA. The transportation model is a
special case of linear programs that deals with shipping a commodity from sources (e.g.,
factories) to destinations (e.g., warehouses). The objective is to determine the shipping schedule
that minimizes the total shipping cost while satisfying supply and demand limits.
The transportation algorithm is based on the assumption that the model is balanced, meaning that
the total demand equals the total supply. If the model is unbalanced, we can always add a
dummy source or a dummy destination to restore balance.

Objectives
 To understand a general transportation model
 To solve SunRay transport model on TORA
 To solve tool sharpening model on TORA
 To understand and interpret the results generated by both the models

Problem Statement
SunRay Transport company ships truckloads of grain from three silos to four mills. The supply
in truckloads and the demand also in truckloads together with the unit transportation costs per
truckload on the different routes are summarized in table. The unit transportation costs are in
hundreds of dollars. The model seeks the minimum cost shipping schedule between the silos and
the mills.
Table10.8 SunRay transportation model

Solution In TORA
Transportation model in TORA can be solved through three methods i.e. northwest corner
method, least count method and vogal approximation method. Procedure is the same for all the
methods, however, results may vary.

Northwest Corner Method


Enter the data in TORA.

Click on solve. The final iteration of the solution report is shown below.

Figure 10.4 Solution by northwest corner method

Least cost method


Enter the data just like in northwest corner method and click solve to get the solution. The final
iteration is shown in figure 10.5.

Figure 10.5 Solution by least count method

Conclusion

The transportation algorithm follows the exact steps of the simplex method. However, instead of
using the regular simplex tableau, we take advantage of the special structure of the transportation
model to organize the computations in a more convenient form. Also, the application of
transportation model is not limited to transporting commodities between geographical sources
and destinations. It can also be applied in areas of tool sharpening service and production
inventory control.

Lab: 08
Title: Solving reddy mix problem and diet problem on AMPL
Introduction
This lab deals with the study and practice of solving problems on software AMPL. All practices
and usage of AMPL are covered in this lab.

Objective
The main objectives of this lab are:
1. To familiar with AMPL tool.
2. To understand the principles of AMPL tool.
3. To understand the general layout of AMPL.
4. To be able to write a program in AMPL.
5. To solve maximization and minimization problems using AMPL.

Problem statement
Ozark farms uses at least 800 lb. of special feed daily. The special feed is mixture of corn and
soybean meal with the following composition:

Feedstuff Protein Fiber Cost ($/lb)

Corn .09 .02 .30

Soybean .60 .06 .90

The dietary requirements of the special feed are at least 30% protein and at most 5% fiber. Ozark
farms wishes to determine the daily minimum-cost feed mix?
Model formulation
In operation research, all types of problems are modeled following four steps. These are:
5. Decision variables
6. Objective function
7. Constraints
8. Solution

Steps mentioned above provides the agenda of how to solve a problem in operation research.
These steps are followed one after the other to get the solution of the problem. They are clearly
showed below. After specifying and completing these steps, the procedure section will show how
to use software TORA and get its services to approach the solution.

Decision variables
X1 = lb of corn in the daily mix
X2 = lb of soybean meal in the daily mix

Objective function
Minimize Z = 0.3x1+0.9x2
Constraints
𝑥1 + 𝑥2 ≥ 800
0.21x1 - 0.3x2 ≤ 0
0.03x1 - 0.01x2 ≥ 0
x1, x2 ≥ 0

Procedure
In AMPL, function/program is typed in two ways. The two ways are: writing program directly in
the AMPL software and another one is typing program in notepad and then opening the AMPL,
calling the program by the name saved adding .txt at the end. Typing program directly in the
AMPL is not a best way because if any error done in the typing of program it will not show the
result, also the user has to type the program again instead of editing the current one. The
procedure for typing the program is:

Following things should be kept in mind while writing a problem in AMPL

 Variables must be declared using the var keyword.


 All lines of code must end with a semi-colon.
 The objective starts with maximize or minimize, a name, and a colon (:). After that, the
objective statement appears.
 Each constraint starts with cn (n = 1, 2, 3…n) and a colon. After that, the equation or
inequality appears.
 Names must be unique. A variable and a constraint cannot have the same name.
 AMPL is case sensitive. Keywords must be in lower case.
 To solve the problem use solve command followed by semi colon.
 To see the values of variables, type display (variable name) followed by a semi colon.

Figure 9 Program/code for Diet Problem in AMPL


Figure 1 shows the program for Diet problem to be solved by tool AMPL.

In order to recall an already written problem in notepad in AMPL, use model (filename).txt.

Figure 10 Solution to Diet problem in AMPL


Conclusion
Sol Figure 2 shows the solution of the Diet Problem solved by the AMPL tool. The farm should
use 470.5882lb of corn and 329.41lb of soybean, which gives a minimum total cost of
$437.6471. This is the only optimal solution.

Lab: 09
Title: Minimal spinning tree
Introduction
This lab deals with solving two network models on TORA. The network model is the most
efficient way to link a number of locations directly or indirectly, finding the shortest route
between two cities, determining the maximum flow in a pipeline network, determining the
minimum-cost flow in a network that satisfies supply and demand requirements at different
locations and scheduling the activities of a project.
The minimal spanning tree (a network optimization algorithm) deals with linking the nodes of a
network, directly or indirectly, using the shortest total length of connecting branches.

Objectives
 To understand the general network problem
 To solve two network problems on TORA using minimal spanning tree model
 To interpret the results generated by TORA

Problem Statement
Midwest TV Cable Company is in the process of providing cable service to five new housing
development areas. Figure below depicts possible TV linkages among the five areas. The cable
miles are shown on each arc. Determine the most economical cable network.
Figure 12.11 Cable connections for midwest TV company

Solution In TORA
Enter the data as shown in the figure 12.2.

Figure 12.2 Entering data


Click on solve to get the solution.

Figure 12.3 Minimal spanning tree output summary


Conclusion:
It took six iterations to solve the model by minimal spanning tree. The resulting minimum cable
miles needed to provide the desired cable service are 11 miles.

Lab No. 10
Title: Shortest Route Maximal Flow
Introduction:
The shortest path problem in additive networks is the min-cost flow problem of a unit flow from
the source on a single path in un-capacitated networks. The losses and gains change the amount
of flow such that the cost of an arc on the path is the product of the cost per unit and the amount
of flow at its entrance.

Problem Statement
Determine the maximal flow in each arc for the network in figure 12.8

Figure 12.8 Network model

Solution in TORA
Enter the data as shown in the figure 12.9.

Figure 12.9 Entering data

Click on solve to get the solution.

Figure 12.10 Maximal flow output summary

Results and discussion


It took 6 iterations to solve the model by minimal spanning tree. The resulting minimum cable
miles needed to provide the desired cable service are 11 miles. The shortest route from city 1 to 8
calculated by TORA is 8 miles. The shortest path that is to be followed is from city 1 to 3 to 6
and then 8. It took 6 iterations to solve the model and the maximal flow between the networks is
19. Distances between each node are given in the table.

Conclusion

The minimal spanning tree algorithm deals with linking the nodes of a network, directly or
indirectly, using the shortest total length of connecting branches. A typical application occurs in
the construction of paved roads that link several rural towns. The road between two towns may
pass through one or more other towns. The most economical design of the road system calls for
minimizing the total miles of paved roads, a result that is achieved by implementing the minimal
spanning tree algorithm.
Shortest path algorithms are applied to automatically find directions between physical locations,
such as driving directions on web mapping websites like MapQuest or Google Maps. For this
application fast specialized algorithms are available.
This problem involves a directed network with arcs carrying flow. The only relevant parameter
is the upper bound on arc flow, called arc capacity. The problem is to find the maximum flow
that can be sent through the arcs of the network from some specified node s, called the source, to
a second specified node t, called the sink. Applications of this problem include finding the
maximum flow of orders through a job shop, the maximum flow of water through a storm sewer
system, and the maximum flow of product through a product distribution system, among others.

Lab: 11
Title: Solving Sensitivity Problem on TORA (TOYCO Model)
Introduction
In linear programming, the parameters of the model can change within certain limits without
chasing the optimum solution to change. This is referred to as sensitivity analysis. With
sensitivity analysis, we can ascertain the impact of this uncertainty on the quality of the optimum
solution. In this lab, TOYCO model is solved using TORA to facilitate the understanding of
sensitivity analysis.

Objectives
 To understand sensitivity analysis
 To solve TOYCO model using TORA
 To interpret the results generated in terms of sensitivity analysis

Problem Statement
TOYCO assembles three types of toys-trains, trucks, and cars-using three operations. The daily
limits on the available times for the three operations are 430,460, and 420 minutes, respectively,
and the revenues per unit of toy train, truck, and car are $3, $2, and $5, respectively. The
assembly times per train at the three operations are 1, 3, and 1 minutes, respectively. The
corresponding times per train and per car are (2, 0, 4) and (1, 2, 0) minutes (a zero time indicates
that the operation is not used).

Procedure for Solution


Decision variables:
x 1 = daily number of units assembled of trains
x 2 = daily number of units assembled of trucks
x 3 = daily number of units assembled of cars

Objective function:
Maximize z=3 x 1+2 x 2+5 x 3

Constraints

x 1+2 x 2+ x 3 ≤ 430(operation 1)
3 x 1+2 x 3 ≤ 460( operation2)
x 1+ 4 x 2 ≤ 420( operation3)
x1, x2, x3≥0

Obtaining Solution in TORA


Enter the data as shown below.

Figure 8.1 Entering data

Click on solve to get the sensitivity analysis for this model.


Figure 8.2 TOYCO model solution

Results and discussion


Analyzing the sensitivity analysis reported generated by TORA reveals that (1) a one-minute
increase in operation 1 time increases z by $1, (2) a one-minute increase in operation 2 time
increases z by $2, (3) a one-minute increase in operation 3 time does not change z. The zero dual
price for operation 3 means that there is no economic advantage in allocating more production
time to this operation. The result makes sense because the resource is already abundant, as is
evident by the fact that the slack variable associated with Operation 3 is positive (20) in the
optimum solution. As for each of Operations 1 and 2, a one minute increase will improve
revenue by $1 and $2, respectively.
The dual prices also indicate that, when allocating additional resources, Operation 2 may be
given higher priority because its dual price is twice as much as that of Operation 1.

Conclusion

Sensitivity Analysis is a systematic study of how, well, sensitive, the solutions of the LP are to
small changes in the data. The basic idea is to be able to give answers to questions of the form:
(1) if the objective function changes in its parameter, how does the solution change? (2) If the
resources available change. How does the solution change? (3) If a new constraint is added to the
problem, how does the solution change?
This lab dealt with solving a linear problem and analyze the results in terms of sensitivity
analysis.
Lab: 13
Title: solve currency arbitrage problem on Excel Solver
Introduction
This lab deals with solving the problem of currency arbitrage using Excel Solver. This problem
involves five different currencies: (1) Dollars (2) Euros (3) British pounds (4) Yen (5) Kuwaiti
Dinar. Investment is given in dollars. In currency business profit is earned by circulating the
money in the international currency markets.

Objectives
 To install solver in excel
 To understand how to enter a problem in solver
 To be able to interpret the results generated through excel solver

Problem statement
Solution
Numeric code

Decision variables
x 12=Dollar amount converted into euros

x 13=Dollar amount converted into British pounds

x 14=Dollar amount converted intoYen

x 15=Dollar amount converted into Kuwaiti dinar

x 21=Euro amount converted into Dollars

x 23=Euro amount converted into British pounds

x 24=Euro amount converted into Yen

x 25=Euro amount converted into Kuwaiti dinar

x 31=British pounds amount converted into Dollars

x 32=British pounds amount converted into Euros

x 34=British pounds amount converted into Yen

x 35=British pounds amount converted into Kuwaiti dinar

x 41=Yen amount converted into Dollars

x 42=Yen amount converted into Euros

x 43=Yen amount converted into British pounds

x 45=Yen amount converted into Kuwaitidinars

x 51=Kuwaitidinars amount converted into Dollars

x 52=Kuwaitidinars amount converted into Euros

x 53=Kuwaiti dinars amount converted into British pounds

x 54=Kuwaiti dinars amount converted into Yen


Objective function
Maximize(z) = y

Constraints

Excel solver

You might also like