0% found this document useful (0 votes)
43 views

Integer Programming

The document discusses integer programming problems such as sudoku puzzles, binary knapsack problems, travelling salesman problems, sequencing and scheduling problems, location-allocation problems, and grouping problems. It provides examples of how to formulate these problems as integer programs with binary variables and constraints in order to find optimal integer solutions. The document notes that integer programming problems are NP-hard and discusses techniques like branch-and-bound for solving them.

Uploaded by

pavan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Integer Programming

The document discusses integer programming problems such as sudoku puzzles, binary knapsack problems, travelling salesman problems, sequencing and scheduling problems, location-allocation problems, and grouping problems. It provides examples of how to formulate these problems as integer programs with binary variables and constraints in order to find optimal integer solutions. The document notes that integer programming problems are NP-hard and discusses techniques like branch-and-bound for solving them.

Uploaded by

pavan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Integer Programming

6 x 6 Sudoku example
Can have 1,2,3,4
   6     5   

           1
Xijk = 1 if position
    4   6    5 i,j takes value k

5     6 2     
Can have 6 only
6           

   1     2   

68 variables, 96 constraints – row, column, box; objective function?


Easy sudoku – LP optimum is
integer valued.
   6     5   
There will be constraint(s)
           1 involving only one variable.
Process of eliminating other
variables gives progressively
    4   6    5 single variable in constraint.
1 2
5     6 2      LP solution is binary.
3 Medium and Hard sudoku –
6            LP solution has fractions. –
Binary IP required.
   1     2   
What is a binary IP problem?

Examples

Assignment problem ?
Travelling Salesman problem
Location problems
Grouping (clustering)
Vehicle Routeing
Supply Chain
Sequencing and Scheduling problems

IP problems are hard

What are hard problems?


Formulating binary IP problems

Binary knapsack

Maximize 4X1 + 6X2 + 9X3 + 2X4


Subject to
2X1 + 4X2 + 5X3 + X4 ≤ 10
Xj = 0,1

I don’t take both phone and i-pod X2 + X 3 ≤ 1

If i take an i-pod, I take a earphone; X4 ≥ X3

I take maximum 2 items..


Formulating binary IP problems

Location - Allocation

I can locate factories (each capacity 100) in 1, 2 or 3.


Cost is 100, 150 and 200. I have to transport 150 items
to A. Unit Costs 2, 1, 2.

Minimize 100Y1 + 150Y2 + 200Y3 + 2X1 + X2 + 2X3

X1 + X2 + X3 = 150
Training example
X1 + X2 + X3 ≤ 100Y1 + 100Y2 + 100Y3 trainer

Yi binary, Xi ≥ 0 Seen in bin packing


Formulating binary IP problems

Sequencing and scheduling

Three candidates are to be interviewed. The times are


12, 10 and 15. Minimize sum of waiting times of
candidates?
Minimize S1 + S2 + S3

I can do either 1 or 2; either S2 ≥ S1 + t1 or S1 ≥ S2 + t2

S1 + t1 – S2 ≤ 0 or S2 + t2 – S1 ≤ 0
S1 + t1 – S2 ≤ Mδ and S2 + t2 – S1 ≤ M(1-δ);
δ = 0, 1, How many constraints are there
3 pairs and 6 constraints for 10 people?
Formulating binary IP problems

Travelling salesman -- 10 8 9 7
10 -- 10 5 6
X13 = X34 = X42 = X25 = X51 = 1 8 10 -- 8 9
X13 = X34 = X42 = X21 = X55 = 1 9 5 8 -- 6
X13 = X31 = X42 = X25 = X54 = 1 7 6 9 6 --

Xjj = 0 or leave out Xjj variables or use big M as cost

X13 + X31 ≤ 1; Xij + Xji ≤ 1


How many constraints
X42 + X25 + X54 ≤ 2; Xij + Xjk + Xki ≤ 2; for a 10 city TSP?
Travelling salesman -- 10 8 9 7
10 -- 10 5 6
ui – uj + nXij ≤ n-1; i = 1,..,n; j =2..n
8 10 -- 8 9
u1 – u3 + 5X23 ≤ 4 9 5 8 -- 6
u3 – u4 + 5X34 ≤ 4 7 6 9 6 --
u4 – u2 + 5X42 ≤ 4 X13 = X34 = X42 = X25 = X51 = 1
u2 – u5 + 5X25 ≤ 4 X13 = X31 = X42 = X25 = X54 = 1
u1 – u5 + 20 ≤ 16

u4 – u2 + 5X42 ≤ 4
u2 – u5 + 5X25 ≤ 4
u5 – u4 + 5X54 ≤ 4
How many constraints
u1 – u3 + 5X13 ≤ 4 for a 10 city TSP?
Formulating binary IP problems

Precedence (Workstations

6 tasks and 3 workstations. Task 5 to be done in same


or later station after task 2

X51, X52, X53, X21, X22, X23

Either X51 + X52 + X53 ≥ X21 or X52 + X53 ≥ X22 or X53 ≥ X23

X51 + 2X52 + 3X53 ≥ X21 + 2X22 + 3X23


Bin Packing problems
GS
1-d Bin packing

• Given a bin capacity C>0 and a list of objects


{p1, p2,...., pn}, what is the smallest number of
bins needed to accommodate all of the objects?
( Each pi has size si, such that 0 ≤si≤ C. i.e. none
of the objects too big to fit in a bin)

• Example:
n=10 items with sizes
44, 24, 24, 22, 21, 17, 8, 8, 6, 6
Bin size is C=61
1d bin packing - applications

– Minimizing wastage problem- standard


length of cable
– Fitting ads in a 3 minute slot
– Lorries to pack items
– Processors to do jobs
Bin packing - Applications

• placing computer files with specified sizes


into memory blocks of fixed size
• recording of all of a composer's music,
where the length of the pieces to be
recorded are the weights and the bin
capacity is the amount of time that can be
stored on an audio CD (about 80 minutes)
Formulation
 Let Yj=1 if bin j is opened and Xij=1 if item i is packed to bin j.
 Minimize Σ Yj
 Subject to Σ Xij=1
 Σ siXij ≤ C
 Xij ≤ Yj, Xij, Yj = 0,1
• Example:
n=13 items with sizes
91, 82, 81, 81, 81, 81, 51, 49, 20, 20, 20, 20, 20
Bin size is C=100. Minimum number of bins needed (LB) = Σsi/C =
697/100= 7.
Optimum = 8 bins
 1d- bin packing is NP-hard
 LP relaxation gives LB. LP optimum is yj=1/M, Xij=1/M with Z = 1 (LP
relaxation gives a very weak bound)
 Tighten with constraint Σ siXij ≤ nYj. Better LB of 6.97
Algorithms

• Branch and Bound


• Lower bound – LP relaxation is always Σti/C
• Can be poor if ti are just greater than C/2 LB to Z
approaches ½
• Better bounds on LB/Z were created
• ¾ is a good bound for LB/Z
• Heuristics
Matching, Assignment, Covering, Location and Grouping problems

1
5 1
5

4 8
3 4 8
3

6
6

2 7 2 7

LP gives binary solution

Unique solution?
Matching – How many pairs can I form?
Matching, Assignment, Covering, Location and Grouping problems
Bipartite Matching – How many pairs can I form?

1 5 1 5

4 8 4 8

3 6 3 6

2 7 2 7

Unique solution?
Matching, Assignment, Covering, Location and Grouping problems

Covering – Where to locate? Minimum nodes to cover all arcs

1
5 1
5

4 8
3 4 8
3

6
6

2 7 2 7

LP gives binary solution. Usually covering is IP

Unique solution?
Matching, Assignment, Covering, Location and Grouping problems

Covering – Where to locate? Cost associated with location

1
5 1
100 400 5
100 400
500 4
8 500 4
100 3 8
100 3
200
200
6
6
100
100
2 7
200 2
200 200 7
200
LP gives binary solution. Usually covering is IP
Min cost covering vs minimum covering
More than 3 locations

Unique solution?
Grouping problem

Formulate the problem


1 to get 3 groups out of 8
5 points?

4 8
3

2 7
Grouping problem

 Xjj = 1 if point j is a seed (or median)


1
5
Xij = 1 if a non-median i is assigned to median j

4 8
3

2 7
Grouping problem

1 X66 = X77 = X88 = 1 (medians)


5

X18 = X26 = X37 = X46 = X58 = 1


4 8
3
Z = 312 or 12

2 7
Clustering problem

  Maths Physics Chemistry Computer English


Science
Azhar 82 77 79 82 65
Bhaskar 87 73 77 88 60
Cindy 79 69 72 95 72
David 73 86 68 98 67
Elizabeth 80 75 76 77 59
Fredrick 91 90 85 81 80
Ganesh 100 88 62 66 72
Hari 85 79 80 77 75

Formulate the problem to get 3 groups out of 8 people?


Clustering problem

  12th Age Proficiency CAT score Can speak


Marks in English (percentile) French?
Azhar 82 27 Medium 92 Y
Bhaskar 87 23 Low 88 N
Cindy 79 32 High 95 N
David 73 30 High 98 N
Elizabeth 80 36 Medium 79 Y
Fredrick 91 29 High 81 Y
Ganesh 98 23 Medium 66 N
Hari 85 19 High 77 Y

Formulate the problem to get 3 groups out of 8 people?

You might also like