# CHOOSING THE BEST ROUTE

Software and s/w Development

Dec 2, 2013 (4 years and 7 months ago)

92 views

CHOOSING THE BEST ROUTE

Because time and money are limited resources, it’s important that we make
well
-
informed decisions. Engineers go through a decision making process that
involves collecting data, analyzing data, and then making a decision
from
there. This is demonstrated in the following example:

Fastest Route

Predict what you think is the fastest way to get from point A to point B.

Your prediction, from fastest to shortest: ___ ___ ___

Now take the string in front of you and co
mpare how long each one is .

Were you correct?

Notice that on all 3 routes, you start and end at the same two points. The only
thing that changes is the way you get there.

Knowing this, what kind of rule can you write about the shortest distance
betwe
en two points?

Rule:

So in real life, we are not going to use string to measure everything. We can
use math to figure out what the shortest distance is. First we’ll need to learn a
little bit more about numbers and math.

Fun
ctions

Functions are

equations that define rules for numbers. Every function has an
input, a transformation, and an output. If this is not clear
-

toaster. You put a piece of bread in, define a setting, and out comes a piece of
toast. You don’t always have to
put bread in a toaster either
-

you can put in a
pop tart, a bagel, and even a toaster strudel. This is similar to functions. So
here’s what we’re trying to understand then:

Baked Good

Toaster

Toasted Baked Good

Input

Transformation

Output

Here is an example of a function:

f(x) = 5x + 3

f(x) tells us it’s a function

“x” will be our input.

5x + 3 is our “transformation.” In other words, it’s our rule for the
number we put in.

Let’s say that we would like 2 to be our input, and see it
transform. We would
write that like this:

f(2) = 5 * 2 + 3

To solve this function, you simply compute the equation.

f(2) = 5 * 2 + 3 = 13

W
e now can say f(2)=13

Try to do the following problems. The first one has been done for you.

Function

f(x)

Input

x

Rewrite equations
with input

f(x) = ?

f(x) = 2(x+3)

4

f(2) = 2(4+3)

f(2) = 14

f(x)=x
2
-
7

3

f(3) = 3
2
-
7

f(3) = 2

f(x)=

7

-

x
3

2

Functions are extremely important in Industrial and Systems Engineering.
When engineers make decisions for a project, these decisions need to follow
certain rules. The way they define these
rules is often with functions.

F
unctions and Graphing

Functions define a rule for numbers. When it comes to graphing, functions
define the relationship between x and y where one x corresponds to
only one
y.

This is what a graph looks like:

Using

the terms we learned earlier,
you graph your input as “x” and your
output as “y”.

Our function is f(x) = 2x

If x= 2, f(x)= 4, which is also our y
-
value. When you write a point on a graph,
you write it in the form (x,y). So thi
s point on our graph is written as (2,4). We
first move along the x
-
axis 2, and then up the y
-
axis 4.

The more inputs you put into your function, the more points you will get.
Eventually you will be able to just “connect the dots” to the get the line of your
graph. Will in the following table for the function f(x)=2x and graph the points
on the graph below
.
Then connect the dots to form a straight line.

x

f(x)

1

2

4

3

4

5

y

x

A graph consists of a vertical
y
-
axis, and a horizontal x
-
axis.

10

9

8

7

6

5

4

3

2

1

1 2 3 4 5

1 2 3 4 5 6 7 8 9 10

Here are some common functions, along with their graphs:

y = x

y = x
2

y = x
3

y=

y = | x |

y =

Math Baseball

Now we are going to play some math baseball!

The class will now be split into two groups. This will be your baseball team. A
baseball diamond is drawn on the board.

Each team will be given a list of math problems.

Whichever team is playin
g defense, or in other words out in the field, will
decide which problems they want to “pitch” to the team at bat. The team who
is up at bat sends a batter to attempt the problem. If this team member gets
the problem right, they go to first base. If they g
et it wrong, it is an out. The
game has the same rules as baseball from here!

CHOOSING
THE BEST SOLUTION

Operations Research: Linear Programming

What is Operations Research?

Operations research (OR) is a scientific approach to analyzing problems and making decisions. OR
professionals aim to provide rational bases for decision making by seeking to understand and structure complex
situations and to use this understanding to pred
ict system behavior and improve system performance. Much of
this work is done using analytical and numerical techniques to develop and manipulate mathematical and
computer models of organizational systems composed of people, machines, and procedures.

In t
he 1950s operations research evolved into a profession with the formation of national societies,
establishment of journals and academic departments in universities. The use of operations research expanded
beyond the military to include both private compani
es and other governmental organizations. The petrochemical
industry was one of the first to broadly embrace operations research to improve the performance of plants,
develop natural resources and plan strategy. Today, operations research plays important ro
les in a variety of
industries such as:

airline
-

scheduling planes and crews, pricing tickets, taking reservations, and planning the size of the
fleet,

pharmaceutical
-

R& D management,

logistics companies
-

routing and planning,

financial services
-

credit scoring, marketing, and internal operations,

lumber and wood products
-

managing forests and cutting timber,

local government
-

deployment of emergency services, and

policy studies and regulation
-

environmental pollution, air traffic safety, AI
DS, and criminal justice
policy.

The field of operations research is closely rel
ated to Industrial engineering. Industrial engineers
consider
Operations Research (OR) techniques to be a major part of their toolset.

Some of the primary tools used by
operations researchers are statistics, optimization, probability theory, queuing
theory, game theory, graph theory, decision analysis, mathematical modeling and simulation. Because of the
computational nature of these fields, OR also has ties to computer s
cience, and operations researchers use
custom
-
written and off
-
the
-
shelf software.

Linear Programming is a method often used to solve large, complicated problems. These problems often require us to determine
how to use resources most
efficiently. In order
to see how linear programming is used to solve such problems, let’s investigate a problem experienced at the ACME Shoe Factor
y. The
ACME Shoe Factory problem is just a fraction of the size of those actually encountered in the real world.

Industrial Engine
ers use linear algebra to find the best solution possible to the problems given certain limits or constraints. For instance y
ou might want to buy as
many candy bars as possible but you only have \$3 dollars to spend. That is an example of a constraint; you
are limited in the number of candy bars you can buy
by how much money you can spend.

Step 1: Understanding the problem

The ACME Shoe Factory makes two types of sport shoes, the

and the
Groundeds
. Now let’s say

you are the Industrial Engineer at the ACME Shoe
Factory. Your boss tells you to figure out how many pairs of each type of shoe to make each week so that you can make the mos
t money.

The ACME Shoe Factory earns \$10 of profit for each pair of

and

\$8.50 for each pair of
Groundeds

they make. There are two steps to make a pair
of shoes at the ACME Shoe Factory. The first step is to cut all the material to the right size on the Super
-
Cutter 9000 machine. The second step is to
assemble all the pieces t
ogether using the EZ
-
Integrator machine.

The number of machines

and factory
working

hours put constraints on the number of pairs of shoes that the ACME Shoe Factory can make. The factory only
has 6 Super
-
Cutter 9000 machines that cut the materials, 850 EZ
-
Integrator machines that assemble the shoes, and the factory is only works 40 hours

a week.

Each hour, each Super
-
Cutter machine can only do 50 minutes of work because it needs 10 minutes each hour to cool off. Each pair of

requires 3
minutes of cutting time while
Groundeds

only require 2 minutes.

Each EZ
-
Integrator machine ta
kes 7 hours to assemble a pair of

and 8 hours to
assemble a pair of
Groundeds
.

Your goal is to change the amount of each type of shoe being produced in order to make the most money, which is the same thin
g as saying your goal is to

maximize
your
profits by changing the amount of

and
Groundeds

produced.

Decision variables

represent a quantity that
you can change.

Example: the number of

each type of shoe to be

Decision Variables for ACME
Shoe Factory

A
= number of pairs of
produced each week

G
= number of pairs of
Groundeds
produced each week

Objective function

the equation that

represents the goal

of either maximizing

profit or minimizing

cost

Constraints

represent limitations
created

by scarce
resources

(time,
equipment, e
tc.).

They are expressed

algebraically by

inequalities.

Step 2: Modeling the problem

Why do we use

=
12,000 minutes?

In order to solve this problem you will need to first describe mathematically what is going on. You know what your goal
maximize

number of

produced each week and by changing
the
number of
Groundeds

produced each week. The
produced and the
Groundeds

produced are the only two
quantities you can actually choose. They are the only part of the problem that require you to make a decision about. We
call these
D
ecision variables.

To
represent

PROFIT = Profit from

+ Profit from
Groundeds

Which is the same thing as saying:

PROFIT = (Price per pair
) x (#

Produced) + (Price per pair
Grounded
s
) x (#
Groundeds

Produced)

PROFT =
Max.
(\$10 x A) + (\$8.50 x G)

This function is called the
Objective function.

N
ext you will need to describe mathematically the constraints on the machines and factory working hours. The first
thing to do is figure out how much
time during the week the Supper
-
Cutter 9000 is actually working in minutes. This is
very simple to do mathematically:

(6 Super
-
Cutter 9000 machines) x (40 work hours per week) x (50 mins per hour) = 12,000 min per week

This means that during the week the

most the Super
-
Cutter can work is 12,000 mins. The Super
-
Cutter 9000’s job is just
to cut the necessary material for both the

and the
Groundeds
. The total amount of time cutting for the two
shoes cannot exceed total number of minutes the Super
-
Cutter is actually working each week. Remembering that it takes
the Super
-
Cutter 9000 3 minutes to cut the material for a single pair of

and that
it takes 2 minutes to cut the
material for a single pair of
Groundeds
, we can mathematically represent this as:

(Cutting Time of
) x (#
) + (Cutting Time of
Groundeds
) x (#
Groundeds
) ≤ (Total Cutting Time)

Which is the same as:

(3 mins x
A) + (2 mins x G) ≤ 12,000 We call this function a
constraint.

0
1000
2000
3000
4000
5000
6000
7000
0
1000
2000
3000
4000
5000
Constraint 1
Constraint 2
At this point, we have mathematically represented the limitations of the Super
-
Cutter 9000. Now we need to the same thing for the EZ
-
Integrator. How many hours of work
can 850 EZ
-
Integrator machines do in a week? This can also be solved fairly easily.

(850 EZ
-
Integrator machines) x (40 work hours per week) = 34,000 hours per week

This means that during the week the most the EZ
-
Integrator can work is 34,000 hours. Just
like with the Super
-
Cutter 9000, the EZ
-
Integrators job is to assemble the material for both the

and the
Groundeds
. The total amount of time assembling the two types of
shoes cannot exceed total number of hours the EZ
-
Integrator is actually workin
g each week. Remembering that it takes the EZ
-
Integrator 7
hours to assemble a single pair of

and that it takes 8 hours to assemble a single pair of
Groundeds
, we can mathematically
represent this as:

(Assembly Time of
) x (#
) +
(Assembly Time of
Groundeds
) x (#
Groundeds
) ≤ (Total Assembly Time)

Which is the same as:

(7 hours x A) + (8 hours x G) ≤ 34,000 This is also a
constraint.

It would never be possible to produce negative quantities of either

or
Groundeds
, but you could produce zero

and
produce all
Groundeds
. Mathematically this is the same as saying:

A≥ 0 and G≥ 0.

This is just saying that A and G cannot be negative. These are also
constraints.

You have now cons
tructed a complete model for what is going on at ACME Shoe Factory. The completed model mathematically looks like:

Objective Function:
PROFT = Max. (\$10 x A) + (\$8.50 x G)

Constraints:
3A + 2G ≤ 12000

7A + 8G ≤ 34000

A≥ 0

G≥
0

We call this a
linear program
.

Step 3: Graphing a Linear Program
-

Feasible Region

The graph of this system of constraints appears below. The shaded region represents the set of

points which satisfy all of the constraints. Values of
A
and
G
which satisfy all of the constraints are called
feasible
and

the set of all such feasible points is called the
feasible region.

Feasible Region

All possible solutions to
the problem lie in the
feasible region or on the
boundary

Graph

G

A

0
1000
2000
3000
4000
5000
6000
7000
0
1000
2000
3000
4000
5000
Constraint 1
Constraint 2
Step 4: Best Production Plan: Searching for the Optimal Solution

We now have a list (or rather graph) of feasible solutions to the original problem. Now we need to evaluate the possible solu
tions and
pick the best one. We call this optimizing and we call the best solution the
optimal solution.

To determine the optimal

solution, there are many strategies you could use. One way is to try all the
possible answers. Lets pick the values A = 1000 and G = 3000. Plugging it into the objective (profit)
equation we get:

fit = \$10.00*A+\$8.50*G

A=1,000 G=3,000 Profit = \$10.00*(1,000)+\$8.50*(3,000)

= \$35,500

However, trying to pick points this way is a rather time con
suming and inefficient way to go about
finding the best solution. Fortunately, there is another way of finding optimal solutions. In fact, there are
many ways. We will briefly examine a few of them here.

Optimal Solution

The optimal

solution yields the

best solution (e.g.

the most profit or

the least cost)

The point we picked earlier is represented on the graph above by the circle. As we can see, this point is within the feasible

region. However,
without too much
difficulty we can find a better solution. Lets pick the point (1000,3375), represented on the graph by a square. Plugging thi
s
into the objective function (profit function) yields:

8.50*G

A=1,000 G=3,375 Profit = \$10.00*(1,000)+\$8.50*(3,375)

= \$38,687.50

This new solution is greater than the old solution, therefore, it is more

optimal. If we continue with this trend of picking points, we find that
the most optimal solutions lay on the boarders of the feasible region. Thinking back over the last two points we picked, this

makes sense
because in the case of the first point we wer
e only producing 3,000 Groundeds when we had enough resources to build as many as 3,375.

Graph

G

A

0
1000
2000
3000
4000
5000
6000
7000
0
1000
2000
3000
4000
5000
Constraint 1
Constraint 2
If we continue to pick points, but this time only from the border of the feasible region, we
will find that the most optimal solutions occur at the four corners of the feasible region.
This is what we call the
Corner Principle
.

The reason for this is
that once we find a point at one of the borders of the feasible region
any better solutions (more optimal solutions) can only be found by traveling up or down the
border until we run into the next side of the border. The graph below illustrates this as wel
l
as representing the corners of the feasible region with circles.

The Corner Principle

states that the

optimal solution

will always lie

on a corner of

the feasible

We can now check the four corner points to see which one is most optimal (greatest

profit) of the four.

A=0 G=0 Profit = \$10.00*(0)+\$8.50*(0)

= \$0.00

A=0 G= 4,250 Profit = \$10.00*(0)+\$8.50*(4,250)

= \$36
,125.00

A=2,800 G=1,800 Profit = \$10.00*(2,800)+\$8.50*(1,800)

= \$4
3,300.00

A=4,000 G=0 Profit = \$10.00*(4,000)+\$8.50*(0)

= \$40,0
00.00

From plugging in the corner points we see that the point (A=2,800,G=1,800) is the most optimal that is, it’s the most
profitable. Since the point is in the feasible region, we know it meets the constraints.

What does this mean? What we have shown
is that mathematically, the ACME Shoe Factory can make the most money
by producing 2,800 Airheads and 1,800 Groundeds. With this production plan, the company should be able to \$43,300
in profit.

Graph

G

A

Workforce Planning at Pizza
π's:

How to Minimize Costs and Still Get the Job Done

Linear programming is one of the most powerful mathematical modeling tools in the field of Operations Research. It helps mana
gers find the best

ways to allocate limite
d resources in order to maximize profits or minimize costs (optimization). For example, McDonald's franchises have used

linear programming to develop worker schedules which minimize their labor costs. Every
linear programming
model includes:

1.) Decision v
ariables,

2.) An objective function to be maximized or minimized, and

3.) A system of inequalities and equations that represents constraints that restrict the decision maker's options.

Anytime a business or corporation has more than one employee and more than one shift there is a scheduling problem. A
scheduling problem

involves determining the number of employees required to get the work done while minimizing the total daily wages. Many

employees with different skills, but some employees may be able to do more than one job. The process of matching up individua

called
manpower planning.
This process becomes more complex when you have to determine a speci
fic work schedule. The most complex

manpower planning problem involves the airlines because they have to coordinate flight crews, ground crews, ticket agents and

airport staff for

flights around the world. Problems of this sort can be solved by a linear pr
ogramming process.

Sample problem:

A new Pizza

outlet sells pizza for carry out, dining in and frozen pizzas to local groceries and gourmet shops. The Pizza

is open from noon

to midnight each day. Toni Pepperoni, the manager of the outlet, needs to
figure out how many people should be scheduled to work each of the

two 8 hour shifts. The daytime shift is from noon to 8 p.m., and the evening shift is from 4 p.m. to midnight. The two shifts

overlap during the

busy dinner period, which starts at about 4
p.m. and continues until about 8 p.m. Based on information about the average number of pizzas

ordered at other outlets, Toni has estimated the number of employees she needs in each four hour period to supply those pizza
s:

noon to 4 p.m.

4 p.m. to 8 p.m.

8
p.m. to midnight

6 employees

16 employees

8 employees

Employees are paid \$5 per hour for hours worked between noon and 8 p.m. The pay per hour between 8 p.m. and midnight is \$7 pe
r hour. Toni

must decide how many people to schedule on the noon to 8 p.m.
shift and how many on the 4 p.m. to midnight shift. There must be enough

workers on duty to complete the workload in each four hour period and the goal is to minimize the amount spent on daily wages

following:

1

2

3

What decisions must Toni mak
e?_______________________________________________________________

Recommend to Toni the number of workers she should schedule each shift. _____________________________

Why did you recommend these
numbers?_________________________________________________________

__________________________________________________________________________________________

Completing the questions which follow will determine if your recommendation is a workable solution
for Toni. You will also find a solution which

minimizes her cost, and will provide enough workers to complete all tasks.

4

Identify all of the variables in this problem. (Hint: read ahead if you get stuck here.)

____________________________________________
______________________________________________

Decision Variables and Constraints:

1

Workforce Planning at Pizza
π's

Two of the variables you should have identified are the number of people working the day

shift and the number of people working the evening shift. These are called
decision variables.

All linear programming problems have decision variables. Decision variables should

completely describe the decisions to be made. The two decision variables in th
e Pizza

problem can be represented by:

Decision variables
:
a set of

variable quantities completely

describing the decisions to be made

D
= number of people scheduled from noon to 8 p.m.;
E
= number of people scheduled from 4 p.m. to midnight.

5

If three
people work the day shift and five people work the evening shift, altogether how much will they make?

_________________________________________________________________________________________

6

Write an expression to represent the total daily wages paid to

employees if Toni schedules
D
workers for the day shift,

and
E
workers for the evening shift? Total daily wages = _______________________________________

In any linear programming problem the decision maker wants to maximize or

minimize some function of
the decision variables. This function is called the

objective function.
In the Pizza

problem Toni wants to minimize the total

daily wages. Therefore, the
objective function.
is: total daily wages = 40D +

48E

Objective Function:
a quantity

to be optimized

which is defined

in terms of the decision variables

constraint.

Constraints

restrictions on

the values of

one or more of

the decision

variables

7

8

9

Toni must have
at least

Toni must have at least

workers scheduled from noon to 4 p.m.; therefore,
D
_ _______.

workers scheduled from 8 p.m. to midnight, so
E

________.

Write an inequality to show the minimum number of workers needed from 4 p.m. to 8 p.m.:

Hint: Both d
ay and evening shifts are working. __________________________________.

A System of Inequalities
-

The Feasible Region:

These inequalities represent restrictions on the decision variables
D
and
E.
These restrictions are called
constraints.

The
optimal solution
is just the best solution to a particular problem. In this case, the values of
D
and
E
which satisfy all of the constraints and

minimize the total daily wages paid to employees is the
optimal solution.
You may recall that the objective fun
ction, total daily wages =

40D + 48E, defines this cost, where
D
represents the number of employees working the day shift, and
E
represents the number of employees

working the evening shift. So how
do
we find the optimal solution for this problem? In other

words, what is the lowest possible total daily wages

that still meets all of the constraints?

First, we need to find all of the values of the decision variables
D
and
E
which satisfy all three of the constraints:

D
>
6,
E
>
8, and
D
+
E
>
16.

2

Workforce Planning at Pizza
π's

One way to do this is to graph each inequality on the same coordinate system. We need to

decide which variable to plot on each axis. Suppose we agree to graph
D
on the horizontal axis

and
E
on the vertical
axis. On a sheet of your own graph paper, graph each of the three

inequalities above and lightly shade the region(s) of the coordinate system containing all of the

points satisfying all three inequalities.

The portion of the graph which you shaded is calle
d the
feasible region.
The feasible region

contains all of the points which
could
be the optimal solution, because they satisfy all of the

constraints.

10
How many points lie in the feasible region? _________________________________

11

Feasible Region:
the set of all

points which satisfy all of

the constraints

Write the coordinates of three points that lie in the feasible region. Include one point that lies on the boundary of the

feasible region. (

,

); (

,

); (

,

) Also mark

and label the points you choose on your graph.

12

Why are boundary points part of the feasible region? ________________________________________________________

13
Does the point (6,8) lie in the feasible region? ______Why or why not?
_________________________________

The Search for Optimality
-

Finding the Best Schedule:

Now that we know the location of all points satisfying the constraints (the feasible region), we can begin to look for the op
timal solution. The

optimal solution must
be one of the points in the feasible region. But which point? Let's begin by considering a point that we know is feasible.

The point (9,10) lies in the feasible region.

14

What does this point represent? ____________________________________________________
_______________

If there are 9 day employees and 10 evening employees, then we can use the objective function to find the total daily wages o
f these employees:

Total daily wages = 40
D
+ 48
E
= 40(9) + 48(10) = 840.

15

D

E

Find the total daily wages for
each of the three points in the feasible region which you identified in # 11.

Total daily wages = 40
D
+ 48
E

16
Did any of your points produce total daily wages

lower than \$840? ______________

17

Are there any points in the feasible region that produce
total daily wages lower than \$840? _______________

,

)

18
Which of your points produced the lowest total daily wages? (

19

What were the total daily wages for that point? ____________________

To help find the optimal solution, we will use the graph of the
line 40D + 48
E
= 840. Add the graph of this equation to your graph of the feasible

region, and label it line
l.

40
D
+ 48
E
=
your
lowest total daily wages to the previous graph and label it line
m.

20

What do you notice about lines
l
and
m?
________________________________________________________

Check with two of your neighbors to see if they have a similar result. (Recall that parallel lines have the same slope.)

Now compare the structure of these two

equations:

line
l:

40D + 48
E
= 840 line
m:

40
D
+ 48
E
=
your
lowest total daily wages

3

Workforce Planning at Pizza
π's

Angelina used the point (12,9) to generate total daily wages of \$912.

21

22

23

What equation did she use to
determine these total daily wages? ______________________________________

Where do you think Angelina's line is with respect to line
l?
________________________________________

Where is her line with respect to
your
line
m?
____________________________________________________

Michael used the point (5,5) to compute total daily wages of \$440. Add the graph of Michael's line to your graph

24

25

Is Michael's line parallel to line
l?
________

Could Michael's line contain the opti
mal solution? ________ Why or why not? ______________________________

On your graph, try to draw the line that represents the optimal solution.

Remember that the "optimal line" will intersect the feasible region, yet

have the lowest possible total daily
wages. Notice that any other line

parallel to the optimal line which has

lower total daily wages fails to intersect the feasible region, while

any other line parallel to the optimal line which intersects the

feasible region has higher total daily wages.

Op
timal Solution
:
the set of values of the decision

variables which satisfies all of the constraints and

achieves the goal of minimizing (or maximizing) the

objective function

The
optimal solution
occurs at the point where the optimal line intersects the
fea
sible region.
In this case, that point has the coordinates (8,8).

26

27

What does this point mean in terms of the problem? _____________________________________________________

What is the lowest total daily wages?
_________________________________________________________________

28

How would you describe the location of the point (8,8) in the

feasible region? __________________________________________

If there is a

unique solution

to a linear programming

problem, it

must occur at

one of the corner points

of the feasible

region.

29

Thinking about the original problem situation, why does this

solution make sense? _____________________________________

The point (8,8) is called a
corner point
of the feasible region. The
feasible region

for this problem has one other corner point.

30

What are the coordinates of the other corner point? (

,

)

4