Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 111

P.N.

Ram Kumar
E-mail: pnramkumar@gmail.com
 Linear Programming problems – Formulation,
Graphical method - Sensitivity Analysis
 Transportation, Transshipment and Assignment
problems
 Network optimization models
 Integer programming problems
 Project management
 Scarce resources – Labor, materials, money…
 Quest for best combination of inputs
 Minimizing costs or Maximizing profits
 Linear Programming (LP) problems
- Linear objective function
- Linear constraints
 Why only LP?
- Majority of real-life problems can be approximated
- Efficient solution procedures
- Easy Sensitivity Analysis
 A small factory makes three products, soap,
shampoo and liquid soap. The processing is done in
two stages at two plants, I and II, each of which
works for 40 hours every week.
 The time required for processing each product at
each plant and the profit of each product are shown
in the table
 Formulate a linear program to maximize the profits
Plant I Plant II Profit / Kg

Soap 3 5 Rs.10

Shampoo 4 4 Rs. 13

Liquid Soap 4 2 Rs. 12

 Hours /
40 hrs 40 hrs
week
1. Decision Variables???
2. Let X1, X2, and X3 be the quantities of soap,
shampoo and liquid soap manufactured per week.
3. Constraints???
4. Time available per week (40 hours)
5. Last, the objective function (Max Profit or
Minimize Cost)
 Maximize
Z = 10X1 +13X2 + 12X3 Objective Function
 Subject to

 3X1 + 4X2 + 4X3 < 40


 5X + 4X + 2X < 40
Constraints
1 2 3

 X1 > 0, X2 > 0, X3 > 0 Non-Negativity


Constraints
 X1, X2 , X3

Decision Variables
 A middle-aged woman, convalescing after a surgery,
has been advised by her doctor to plan her diet in
such a way as to ensure that she gets the prescribed
quantities of vitamins.

 The choice of foods available to her, the amounts of


vitamins they contain, the cost of each unit and the
daily requirement of vitamins are shown in the table
Cost Vitamin A Vitamin B Vitamin D

Eggs Rs 1.50/unit 15 mg/unit 40 mg/unit 10 mg/unit

Milk Rs. 14.00/lit 30 mg/lit 25 mg/lit 20 mg/lit

Rs. 18/unit
Cereals 10 mg/kg 55 mg/kg 30 mg/kg
(kg)
Daily
  100 mg 250mg 120mg
requirement
 Formulate a linear programme to determine the
quantity of each food that the woman needs to buy in
order to minimize her total expenditure, ensuring at
the same time that she meets her daily requirements
of vitamins.
 Decision Variables?
 X1, X2, X3 be the quantities of eggs, milk and cereals
bought
 Constraints?
 Dietary requirements are to be satisfied
 Objective Function
 Minimization of expenditure
 Let X1, X2, X3 be the quantities of eggs, milk and
cereals bought.
 The problem is of the form
(i) There is an objective function which describes
what we desire

(ii) A set of constraints, usually in the form of


inequalities

(iii) Non-negativity constraints for the decision


variables

(iv) The objective function and the constraints are


linear.
Max / Min Z = C1 x1 + C2 x2 +…..+ Cn xn
Subject to

a11 x1 + a12 x2 + ……+ a1n xn < or ≥ b1


a21 x1 + a22 x2 + ……+ a2n xn < or ≥ b2
.
.

an1 x1 + an2 x2 + ……+ amn xn < or ≥ bm

x1 , x2 ,….., xn - Unrestricted in Sign


b1 , b2 ,….., bm - Unrestricted in Sign
OR
Maximize / Minimize Z   C j x j
j

Subject to
a x
j 1
ij j  or  bi i  1.....m

bi  Unrestricted in sign i  1.....m


x j  Unrestricted in sign j  1.....n
 A financial advisor who recently graduated from IIMK
received a call from a client who wanted to invest a
portion of a $ 150,000 inheritance
 The client wanted to realize an annual income, but
also wanted to spend some of the money
 After discussing the matter, the client and the
adviser agreed that a mutual fund, corporate bonds,
and a money market account would make suitable
investments.
 The client was willing to leave allocation of the funds
among these investment vehicles to the financial adviser,
but with the following conditions:
 At least 25 percent of the amount invested should be in the money
market account
 A maximum of only 35% should be invested in corporate bonds
 The investment must produce at least $ 12,000 annually (ROI)
 The un-invested portion should be as large as possible
 The annual returns would be 11 percent for the mutual
fund, 8 percent for the bonds, and 7 percent for the
money market
 Formulate an LP model that will achieve the client’s
requests. Ignore transaction costs, the adviser’s fee and
so on.
 Let X1, X2, X3 be the amounts to be invested in mutual fund,
corporate bonds and money market
 Non-negativity condition: X1, X2, X3 ≥ 0
 At least 25 percent of the amount invested should be in the
money market account
X3 / (X1+X2+X3) ≥ 0.25
 A maximum of only 35% should be invested in corporate bonds
X2 / (X1+X2+X3) ≤ 0.35
 The investment must produce at least $12,000 annually (ROI)
0.11X1 + 0.08X2 + 0.07X3 ≥ 12000
Objective Function: Maximize Z = 150,000 – (X1 + X2 + X3)
 A senior executive of a public sector company
recently quit his job under the VRS with a hefty
packet of Rs 1 Crore. Messrs. Dhana-chor Chit
Fund Company has offered the following
investment scheme for the benefit of such retired
people:
 "Invest a certain sum (in lakhs of rupees) in any
month, invest half of that amount in the next
month and in the subsequent month, one would
get twice the amount invested originally in the first
month”
 This scheme is available only for the next six
months (Encashment is possible on 181st day)
 Returns received at the end of any month can be
used immediately for reinvesting either as a fresh
investment or as a follow-up investment
 Let Xt = Fresh investment in the tth month
(t = 1,2,3,4,5) (in lakhs of Rs.)
 Noting that, in any month, the cash outflow
must not exceed the cash on hand, the
following linear programme is formulated
 On 181st day, the cash on hand must be maximum
 Hence the objective function is
A brewery blends three raw materials, A, B and C in
varying proportions to obtain three final products,
D, E and F. The salient data is given below.
Final D E F
Product
Net Profit/ $15 $9 $12
Litre

Ingredient A B C
Cost/ Litre $10 $8 $7

Quantity 10,000 12,000 15,000


Available
Final Product Specifications
D At least 25% of ingredient ‘A’
Not more than 15% of ‘C’

E At least 50% of ingredient ‘B’


Not more than 30% of ‘C’

F At least 65% of ingredient ‘C’


Not more than 5% of ‘A’

Formulate a linear programme to maximize the total


revenue of the brewery.
Solution to Example Problem No.5
Let Xij be the quantity of the ith raw material in jth the
product

A
B
C
A shipping company has to lift three types of
cargo whose details are given below.

Type of Quantity Volume per Profit per


Cargo (tons) ton ton

A 300 1.2 m3 Rs. 10,000


B 500 0.8 m3 Rs. 7,000
C 400 1 m3 Rs. 8,000
 Weight in aft, center, forward must be in the
same proportion as the holding capacities
by weight, i.e., 100 : 200 : 75

 Formulate a linear programme to maximize


the profits of the shipping company.
Solution to Example Problem No.6
Constraints on holding space
 A final product is assembled with 4 units of
component A and 3 units of component B.
 The manufacturing shop runs three different
processes, each of which requires varying amounts of
raw materials and produce different amounts of A
and B.
 Two types of raw materials are used. 100 units of raw
material I (RM I) and 200 units of raw material II (RM
II) are available to the shop each day
Formulate a linear programme to maximize the number
of completed assemblies produced each day.
 Let X1, X2, X3 be the number of runs of each
process operated per day
 Total quantity of A produced =
 Total quantity of B produced =
 No. of units of finished product??
 A machine tool company conducts a job-training program
for machinists
 Trained machinists are used as teachers in the program at a
ratio of one for every ten trainees. The training program
lasts for one month (Assumption: No. of trainees – multiple of 10)
 From past experience it has been found that out of ten
trainees hired, only seven complete the program
successfully (the unsuccessful trainees are released)
 Trained machinists are also needed for machining and the
company’s requirements for the next three months are as
follows:
January 100
February 150
March 200
In addition, the company requires 250 trained machinists by
April. There are 130 trained machinists available at the
beginning of the year. Payroll costs per month are:
Each Trainee $ 400
Each trained machinist $ 700
(machining or teaching)
Each trained machinist idle $500
(Union contract forbids firing trained machinists)
Set up the linear programming problem that will produce the
minimum cost hiring and training schedule and meet the
company’s requirements.
Every month, a trained machinist can do one of the
following:
(1) Work a machine, (2) Teach or (3) Stay idle
Since the number of trained machinists for machining is
fixed, the only decision variables are the number teaching
and the number idle for each month. Thus, the decision
variables are:
X1 – trained machinists teaching in January
X2 – trained machinists idle in January
X3 - trained machinists teaching in February
X4 – trained machinists idle in February
X5 – trained machinists teaching in March
X6 – trained machinists idle in March
Number machining + Number teaching + Number idle =
Total trained machinists available at the beginning of
the month
For January : 100 + X1 + X2 = 130
For February : 150 + X3 + X4 = 130 + 7X1
For March : 200 + X5 + X6 = 130 + 7X1 + 7X3

Since the company requires 250 trained machinists by


April,
130 + 7X1 + 7X3 + 7X5 = 250
Objective Function: Minimize Z = 400 (10X1 + 10X3 +
10X5) +700 (X1 + X3 + X5) +500 (X2 + X4 + X6)
A company has two grades of inspectors, 1 and 2,
who are to be assigned for a quality control inspection. It
is required that at least 1800 pieces be inspected per 8-
hour day. Grade 1 inspectors can check pieces at the rate
of 25 per hour, with an accuracy of 98%. Grade 2
inspectors check at the rate of 15 pieces per hour, with an
accuracy of 95%.
The wage rate of a Grade 1 inspector is $ 4.00 per
hour, while that of a Grade 2 inspector is $ 3.00 per hour.
Each time an error is made by an inspector, the cost to
the company is $ 2.00. The company has available for the
inspection job 10 Grade 1 inspectors, and 8 Grade 2
inspectors. The company wants to determine the optimal
assignment of inspectors, which will minimize the total
cost of the inspection.
43
 A furniture shop manufactures tables and chairs.
The operations take place sequentially in two work
centers.
 The associated profits and the man hours required
by each product at each work center are shown in
the table.
 Formulate a linear program to determine the
optimal number of tables and chairs to be
manufactured so as to maximize the profit.
Available
Furniture Shop Tables Chairs man
hours
Profit / unit 8 6

Work Center-I 4 2 60
Work Center-II 2 4 48

Maximize Z  8 x1  6 x2
Subject to
4x1  2 x2  60
2x1  4 x2  48
x1 , x2  0
Max / Min Z = C1 x1 + C2 x2 +…..+ Cn xn
Subject to

a11 x1 + a12 x2 + ……+ a1n xn = b1


a21 x1 + a22 x2 + ……+ a2n xn = b2
.
.

an1 x1 + an2 x2 + ……+ amn xn = bm

x1 , x2 ,….., xn - ≥ 0
b1 , b2 ,….., bm - ≥ 0
 Slack variable: Added to a ≤ constraint
2x1+ 3x2 ≤50
2x1+3x2+x3=50
 Surplus variable: Added to a ≥ constraint
5x1+ 7x2 ≥120
5x1+ 7x2 -x3=120
 Dealing with Unrestricted in Sign variables
x1 – URS
Let x2, x3 ≥ 0; x1 = x2 – x3
 Infeasibility
◦ Occurs in problems where to satisfy one of the constraints,
another constraint must be violated.

 Unbounded Problems
◦ Exists when the value of the objective function can be
increased without limit.

 Multiple or Alternate Optimal Solutions


◦ Problems in which different combinations of values of the
decision variables yield the same optimal value.
 Maximize
Z = 10X1 +13X2 + 12X3

 Subject to
3X1 + 4X2 + 4X3 < 40
5X1 + 4X2 + 2X3 < 40

X1 > 0, X2 > 0, X3 > 0


◦ Enables the decision maker to determine how a change in one
of the values of a model will impact the optimal solution and
the optimal value of the objective function while holding all
other parameters constant.

◦ Provides the decision maker with greater insights about the


sensitivity of the optimal solution to changes in various
parameters of a problem.

◦ Change(s) in the value of objective function coefficient(s)

◦ Change(s) in the right-hand-side(RHS) value of constraint(s)

◦ Change in a coefficient of a constraint


 The range of objective function values for which
the optimal values of the decision variables would
not change
 A value of the objective function that falls within
the range of optimality will not change the optimal
mix of the variables, although the optimal value of
the objective function will change
 The range of values over which the right-hand-side
(RHS) value can change without causing the shadow
price to change
 Within the range of feasibility, the same decision
variables will remain optimal, although their values
and the optimal value of the objective function will
change
 Analysis of RHS changes begins with determination of
a constraint’s shadow price in the optimal solution
 Within the range of feasibility, the amount of

change in the optimal value of the objective

function per unit change of the RHS value of a

constraint
 Maximization Problems

 Minimization Problems

 100% rule
 A large automobile company owns 5 manufacturing plants in India
at the following locations:
- Jamshedpur
- Pune
- Lucknow
- Uttarakhand
- Sanand, Gujarat
 The automobiles (for simplicity, consider only one model)
produced are shipped to 4 regional warehouses located across the
country in:
- New Delhi (North)
- Kolkata (East)
- Bangalore (South)
- Mumbai (West)
 Weekly production in each plant is known
 Weekly demand at each warehouse is known
SUPPLY DEMAND

S1 1 C11
C12
C14 C13 1 D1
S2 C21
2 C22
C23
C24 2 D2
S3 3

3 D3
S4 4
C51 C52
4 D4
C53
S5 5 C54

Sources Possible
of Supply distribution routes Destinations
Notations:
m- Number of sources
n- Number of destinations
Si - Supply at source i, i = 1, 2, 3, 4,5
Dj - Demand at destination j, j = 1, 2, 3, 4
Cij - Cost of transportation per unit from
source i to destination j
Xij - Number of units to be transported from source i
to destination j

The Transportation Problem seeks to find an allocation


from the 5 sources to the 4 destinations such that the
total cost of transportation is minimum
Destination

Source 1 2 3 4 Supply

1 C11 C12 C13 C14 S1

2 C21 C22 C23 C24 S2

3 C31 C32 C33 C34 S3

4 C41 C42 C43 C44 S4

5 C51 C52 C53 C54 S5

Demand D1 D2 D3 D4
Minimize Z  C11 X 11  C12 X 12  .....  C21 X 21  C22 X 22  ..... 
C31 X 31  C32 X 32  ....  C41 X 41  C42 X 42  ...... 
C51 X 51  C52 X 52  C53 X 53  C54 X 54  C55 X 55
Subject to
X 11  X 12  X 13  X 14  S1 X 11  X 21  X 31 +X 41 +X 51  D1
X 21  X 22  X 23  X 24  S2 X 12  X 22  X 32 +X 42 +X 52  D2
. .
. .
X 51  X 52  X 53  X 54  S5 X 15  X 25  X 35 +X 45 +X 55  D5
X ij  0  i  1, 2,...m and j  1, 2,...n
m n
Minimize Z    Cij X ij
i 1 j 1

Subject to
n

X
j 1
ij  Si , i  1, 2,...m

X
i 1
ij  Dj , j  1, 2,...n

X ij  0  i  1, 2,...m and j  1, 2,...n


n n
Suppose S j 1
i  D j 1
j


m n
Minimize Z   C
i 1 j 1
ij X ij

Subject to
n

X
j 1
ij  Si , i  1, 2, ...m

X
i 1
ij  Dj , j  1, 2,...n

X ij  0  i  1, 2,...m and j  1, 2,...n


 A company has seven manufacturing units situated in
different parts of the country.
 Due to recession, it is proposed to close four of these and
to concentrate production in the remaining three units.
 Production in these three units (E, F, and G) will actually
be increased from present levels and would require an
increase in the personnel employed in them.
 Personnel at the closed units expressed their desire for
moving to any one of the remaining units and the
company is willing to provide them relocation expenses.
 The retraining expenses would have to be incurred as the
technology in these units is different.
 Not all existing personnel can be absorbed by transfer and
a few of them have to be retrenched.
 As per labor laws, cost of retrenchment is given as a
general figure at each unit closed.
 Formulate a LP model to determine the most economical
way to transfer/retrench personnel from units closed to
those units which will be expanded.
1
1

1
2
2

2
3
3

3
4
4

Sources Transshipment nodes Destinations


Demand Constraints Supply Constraints
Y11  Y21  Y31  D1 X 11  X 12  X 13  S1
X 21  X 22  X 23  S 2
Y12  Y22  Y32  D 2
X 31  X 32  X 33  S3
Y13  Y23  Y33  D3
X 41  X 42  X 43  S 4
Y14  Y24  Y34  D 4 X 51  X 52  X 53  S5
Transshipment nodes
X 11  X 21  X 31  X 41  X 51  Y11  Y12  Y13  Y14
X 12  X 22  X 32  X 42  X 52  Y21  Y22  Y23  Y24
X 13  X 23  X 33  X 43  X 53  Y31  Y32  Y33  Y34
5 3 3 4
Minimize  ij ij  klYkl
C X  C
i 1 j 1
'

k 1 l 1
4

Y
i 1
ij  D j  j  1, 2,3, 4 (Demand Constraints)
3

X
j 1
ij  Si  i  1, 2,3, 4 (Supply Constraints)

5 4

X
i 1
ij   Y jk  j  1, 2,3 (Transshipment Constraints)
k 1

X ij  0  i  1, 2,...5, j  1, 2,3
Ykl  0  k  1, 2,3, l  1, 2,3, 4
A group of four boys and four girls are planning on a one day
picnic. The extent of mutual happiness between boy i and
girl j when they are together is given by the following
matrix (data obtained from their previous dating
experiences)
Girl

1 2 3 4

1 11 1 5 8

Boy 2 9 9 8 1

3 10 3 5 10

4 1 13 12 11
 The problem is to decide the proper matching
between the boys and the girls during the picnic that
will maximize the sum of all the mutual happiness of
all the couples. Remember, a boy can team-up with
only one girl and vice-versa.
 What are the decision variables?
 Constraints?
 Objective Function?
 Decision Variable
1, if boy i teams-up with girl j
Let Xij =
0, Otherwise
 Constraints
X 11  X 12  X 13  X 14  1 X 11  X 21  X 31  X 41 =1
X 21  X 22  X 23  X 24  1 X 12  X 22  X 32  X 42 =1
X 31  X 32  X 33  X 34  1 X 13  X 23  X 33  X 43 =1
X 41  X 42  X 43  X 44  1 X 14  X 24  X 34  X 44 =1
 Objective Function
Maximize
11X 11  1X 12  5 X 13  8 X 14 
9X 21  9 X 22  8 X 23  1X 24 
10 X 31  3 X 32  5 X 33  10 X 34 
1X 41  13 X 42  12 X 43  11X 44
n n
Maximize / Minimize Z  C
i 1 j 1
ij X ij

Subject to
n

X
j 1
ij  1, i  1, 2,...n

X
i 1
ij  1, j  1, 2,...n

1, if i is assigned to j
X ij 
0, otherwise
 Minimum Spanning Tree Problem (MST)

 Shortest Path Problem (SPP)

 Maximal Flow Problem


 In its simplest sense, a network is a set of
nodes/vertices with arcs/edges connecting them
2
 Undirected/Directed
4
 Connected Graph 1

 Sub-graph 3

 Tree: Connected sub-graph with no cycles


 Spanning Tree
1. Dijkstra’s Algorithm – small problems
2. Mathematical Model - Complex networks
1, if traversed from node i to node j
X ij  
0, otherwise
Constraints:
1: X12+X13-X21-X31 = 1
2: X21+X23+X24-X12-X32-X42 =0
3: X31+X32+X34+X35+X37-X13-X23-X43-X53-X73 =0
4: X42+X43+X45+X46-X24-X34-X54-X64 =0
5: X54+X53+X56+X57-X45-X35-X65-X75 =0
6: X64+X65+X67-X46-X56-X76 =0
7: X73+X75+X76-X37-X57-X67 = -1
n n
Minimize Z    Cij X ij
i 1 j 1, j  i

Subject to
 1, if i is a source node
n n

 X ij   X ki  0, if i is a transhipment node
j 1; j  i k 1; k  i  1, if i is a destination node

1, if traversed from i to j
X ij  
0, otherwise
F

F
Maximize F
F  f12  f13  f14
f12  f 32  f 52  f 21  f 23  f 25
f13  f 23  f 43  f 53  f 63  f31  f32  f34  f35  f36
f14  f 34  f 74  f 41  f 43  f 47
f 25  f 35  f 65  f85  f 52  f53  f56  f58
f 36  f 56  f 76  f86  f 96  f 63  f 65  f 67  f 68  f 69
f 47  f 67  f97  f 74  f 76  f 79
f 58  f 68  f 98  f10 8  f85  f86  f89  f8 10
f 69  f 79  f89  f10 9  f96  f97  f98  f9 10
f810  f9 10  F
f12  20 f 21  0 f13  15 f31  0 f14  22 f 41  0
f 25  18 f52  0 f 23  20 f32  10 f34  0 f 43  5
f35  20 f53  0 f36  13 f 63  0 f 47  18 f74  0
f56  10 f 65  0 f58  14 f85  0 f 67  5 f 76  0
f 68  25 f86  0 f 69  5 f96  0 f 79  20 f97  0
f89  10 f98  0 f810  30 f108  0 f910  25 f109  0
Consider the following road network connecting six cities

(0,10,1)

2 4 (0,18,2)
(0,17,2)
(0,15,2)

6
1 (0,5,3) (0,5,6)

(0,5,3)

(0,25,1) (0,17,3)
3 5
(0,20,5)

The three numbers are the least amount you can ship along the arc, the
maximum tonnage you can ship, and the cost in dollars per ton shipped
along this arc, respectively. There are 30 tons of material at city 1 and it
should be shipped to city 6 at minimum total cost. All materials originate at
city 1 and end up in city 6.
 Traveling Salesman Problem (TSP)
 Facility Location Problem
 Knapsack Problem
 Set-Covering Problem
 Set-Partitioning Problem
 Integer programming problems do not readily
lend themselves to sensitivity analysis as only
a relatively few of the infinite solution
possibilities in a feasible solution space will
meet integer requirements
 Problem Description:
Given a list of cities and their pair-wise distances, the

problem is to find the shortest possible tour for a

salesman who starts from a city, visits each and every

city exactly once and comes back to the starting city


 This problem is also known as Hamiltonian Circuit

in Graph Theory.
 Number of feasible solutions for a ‘n’ city problem?
 For a 10 city problem:36,28,800 solutions
 For a 15 city problem:1,307,674,368,000!!!!!
 Optimal solution for 15,112 towns in Germany (2001)
- Network of 110 processors at Rice and Princeton
- Computational time equivalent: 22.6 years
 Optimal solution for 33,810 points on a PCB (2005)
 85,900 points – Concorde TSP solver - current record
– April 2006 (136 CPU years)
 Logistics: Vehicle routing

 PCB manufacturing – Soldering using Robots

 Gene mapping – DNA sequencing

 Protein function prediction


n n
Minimize Z    Cij X ij
i 1 j 1

Subject to
n

X
j 1
ij  1, i  1, 2,...n

X
i 1
ij  1, j  1, 2,...n

1, if travelled from city i to city j


X ij 
0, otherwise
Cost of traveling from city i to city j ( or )

Cij   Distance from cit y i to city j (or)
 Travel time between city i to city j

• Miller-Tucker-Zemlin (MTZ) Formulation (1960)

u1  1
2  uj  n  j 1
ui  u j  1  (n  1)(1  X ij ) i  1, j  1
Decision 1:
Hyderabad Where to locate the D1
1
facilities?
Mumbai Kochi
Decision 2:
Chennai Surat From each chosen facility, 2 D2
how much should be
Delhi Lucknow
shipped to the destinations
Bangalore 3 D3
Pune for satisfying the demand?
Kolkata Vizag
Costs incurred:
1. Fixed cost of locating a
Ahmedabad 4 D4
facility (Fi)
2. Transportation costs (Cij)
Set of Potential locations
for facilities (m) Destinations (n)
m m n
Minimize Z=  Fi X i    Cij yij
i 1 i 1 j 1

Subject to
n

y
j 1
ij  Si X i  i  1.......m

y
i 1
ij  D j  j  1.......n

1, if location i is selected


Xi  
0, otherwise
yij  Quantity shipped from facility i to destination j
Si  Supply at facility i
D j  Demand at destination j
 A thief breaks into a museum. Fabulous paintings,
sculptures, and jewels are everywhere.
 The thief has a good eye for the value of these objects,
and knows that each will fetch hundreds or thousands
of dollars on the clandestine art collector’s market.
 But, the thief has only brought a single knapsack to the
scene of the robbery, and can take away only what he
can carry.
 What items should the thief take to maximize the haul?
 More formally:
 The thief must choose among n items, where the i th

item is worth Vi dollars and weighs Wi pounds


 Carrying at most ‘K’ pounds, maximize the value of
knapsack
 Note: assume Vi, Wi, and K are all integers

 An item must be taken or left in entirety

 Applications: Resource utilization, Capital investments and


Financial portfolios, Cryptography etc
n
Maximize Z=  V j X j
j 1

Subject to
n

W
j 1
j Xj K

1, if object j is selected


Xj 
 0, otherwise
Node1 : 1, 2, 7, 8, 9
Node3 : 1, 2, 3, 4, 5, 10
2 3 Node5 : 3, 4, 5, 6, 9, 10
Node7 : 1, 5, 6, 7, 8, 9, 10
1 10 Node9 : 3, 6, 7, 8, 9,10
9
4 Cost of opening
5 nodes:
8 5
6 Node 1: 125
Node 3: 85
7 Node 5: 70
Node 7: 100
Node 9: 110

Determine which nodes should be opened to provide


coverage to all neighborhoods at a minimum cost?
Service Nodes
1 3 5 7 9
Cost 125 85 70 100 110
1 1 1 0 1 0
2 1 1 0 0 0
3 0 1 1 0 1
Localities
4 0 1 1 0 0
5 0 1 1 1 0
6 0 0 1 1 1
7 1 0 0 1 1
8 1 0 0 1 1
9 1 0 1 1 1
10 0 1 1 1 1
1, if node j provides service (j = 1,3,5,7,9)
Xj  
 0, otherwise
Minimize Z=125X 1  85 X 3  70 X 5  100 X 7  110 X 9
Subject to
X1  X 3  X 7  1
X1  X 3  1
X3  X5  X9  1
X3  X5  1
X3  X5  X7  1
X5  X7  X9  1
X1  X 7  X 9  1
X1  X 5  X 7  X 9  1
X3  X5  X7  X9  1
n
Minimize Z=  C j X j Applications:
j 1
1.Vehicle routing problems
Subject to
n 2.Facility location
a
j 1
ij X j  1  i  1.....m
3.Airline crew scheduling

X j   0,1 4.Circuit design


5.Resource allocation
6.Capital investment

You might also like