Title: Network Flow Models
1Heuristics
If possible, we would like an algorithm that
finds an optimal solution to our problem. For
example, we solved shortest path problems or
transportation problems optimally. Some models
(in logistics management or other disciplines),
however, are so complex that it is impossible to
solve them optimally in a reasonable amount of
computer time. For many optimization problems,
therefore, a manager might be satisfied with a
solution that is good but not optimal.
2Heuristics
If an algorithm is guaranteed to find an optimal
solution to a problem, we say it is an exact
algorithm. Algorithms without such guarantees
are called heuristic algorithms or simply
heuristics. A heuristic is a rule that is
typically guided by common sense and will
generally provide good, but not necessarily
optimal, solutions.
3Heuristics
Finding a minimum-cost distribution plan for
shipping from four plants to five
warehouse. Unit transportation costs as well as
demand and capacity values are given in the
following table.
Las New Houston Vegas Orleans Chicago Portland
Capacity Los Angeles 5 1 5 7 4 150 Denver 9 7 8 3
5 200 Pensacola 3 4 3 8 6 175 Cincinnati 4 5 6 2 7
100 Demand 80 110 150 100 150
4Heuristics
Las New Houston Vegas Orleans Chicago Portland
Capacity Los Angeles 5 1 5 7 4 150 Denver 9 7 8 3
5 200 Pensacola 3 4 3 8 6 175 Cincinnati 4 5 6 2 7
100 Demand 80 110 150 100 150
Los Angeles ? Las Vegas 110 d(LV)0 s(LA)40 cos
t110 Cincinnati ? Chicago 100 d(Ch)0 s(Ci)0
cost200 Pensacola ? Houston
80 d(H)0 s(Pe)95 cost240 Pensacola ? New
Orleans 95 d(NO)55 s(Pe)0 cost285
5Heuristics
Los Angeles ? Las Vegas 110 d(LV)0 s(LA)40 cos
t110 Cincinnati ? Chicago 100 d(Ch)0 s(Ci)0
cost200 Pensacola ? Houston
80 d(H)0 s(Pe)95 cost240 Pensacola ? New
Orleans 95 d(NO)55 s(Pe)0 cost285 Los
Angeles ? Portland 40 d(Po)110 s(LA)0 cost160
Denver ? Portland 110 d(Po)0 s(D)90 cost55
0 Denver ? New Orleans 55 d(NO)0 s(D)35 cost
440
Total cost is 1,985, which is higher than the
optimal cost 1,820.
6Heuristics
Bin Packing Problem (BPP)
Given a list of n items each of size si, how can
we assign each item to a bin (box) such that bin
capacity is not exceeded and at the same time the
number of used bins is minimized. The size of
items is 0
7Heuristics
Many heuristics have been developed for this
problem. 1. First-Fit Place item 1 in bin 1.
For an item being examined, scan the bins one by
one and put the item in the bin where it fits
first. If an item fits in none of the bins that
currently contain item(s), introduce a new bin
and place the item in it.
item 1 2 3 4 5 6 7 8 total size 0.3 0.2 0.7 0.8
1 0.6 0.3 0.5 4.4 size 0.9 0.2 0.9 0.2 0.9 0.2
0.9 0.2 4.4
8Heuristics
item 1 2 3 4 5 6 7 8 total size 0.3 0.2 0.7 0.8
1 0.6 0.3 0.5 4.4 size 0.9 0.2 0.9 0.2 0.9 0.2
0.9 0.2 4.4
3
8
6
5
4
1,2,7
0.8 0.7 0.8 1 0.6 0.5
9Heuristics
2. Best-Fit Place item 1 in bin 1. For an item
being examined, scan the bins one by one and put
the item in the bin with the largest content. If
an item fits in none of the bins that currently
contain item(s), introduce a new bin and place
the item in it.
10Heuristics
item 1 2 3 4 5 6 7 8 total size 0.3 0.2 0.7 0.8
1 0.6 0.3 0.5 4.4 size 0.9 0.2 0.9 0.2 0.9 0.2
0.9 0.2 4.4
11Heuristics
3. First-Fit Decreasing Sort the items in
non-increasing order of their size and perform
First-Fit.
item 1 2 3 4 5 6 7 8 total size 0.3 0.2 0.7 0.8
1 0.6 0.3 0.5 4.4 sorted 1 0.8 0.7 0.6 0.5 0.3 0
.3 0.2 4.4 size 0.9 0.2 0.9 0.2 0.9 0.2 0.9 0.2
4.4 sorted 0.9 0.9 0.9 0.9 0.2 0.2 0.2 0.2 4.4
12Heuristics
item 1 2 3 4 5 6 7 8 total size 1 0.8 0.7 0.6 0
.5 0.3 0.3 0.2 4.4 size 0.9 0.9 0.9 0.9 0.2 0.2
0.2 0.2 4.4
13Heuristics
4. Best-Fit Decreasing Sort the items in
non-increasing order of their size and perform
Best-Fit.
14Heuristics
item 1 2 3 4 5 6 7 8 total size 1 0.8 0.7 0.6 0
.5 0.3 0.3 0.2 4.4 size 0.9 0.9 0.9 0.9 0.2 0.2
0.2 0.2 4.4
15Heuristics
Knapsack Problem
A hiker must decide which goods to include in his
knapsack on a forthcoming trip. He must choose
from among n objects Object i has weight wi (in
kg) and a utility ui to the hiker. The objective
is to maximize the utility of the hikers trip
subject to the weight limitation that he can
carry no more than W kilograms.
16Heuristics
Mathematical programming formulation
xi 1 if he takes object i with him 0 otherwise
17Heuristics
object 1 2 3 4 5 weight (w) 3 5 1 3 2 utility
(u) 6 8 4 3 6 knapsack capacity W 6 kg.
18Heuristics
A simple heuristic for the knapsack problem is
to a. calculate the ratio ui/wi for each
object, b. order the objects in decreasing order
of this ratio c. select the variables to include
in the solution one at a time by considering
feasibility.
object 1 2 3 4 5 weight (wi) 3 5 1 3 2 utility
(ui) 6 8 4 3 6 ui/wi 2 1.6 4 1 3
19Heuristics
1. Consider the variables in the order x3, x5,
x1, x2, x4 2. x31 total weight 1 x51 total
weight 3 x11 total weight 6 3. Total
utility 16
20Heuristics
object 1 2 3 4 5 weight (w) 3 5 1.5 3 2.5 uti
lity (u) 6 8 4 3 6 knapsack capacity W 6 kg.