22
Integer Integer Programming and Programming and Logic-Based Logic-Based Modeling Modeling Jan Fábry, Jan Pelikán Jan Fábry, Jan Pelikán ___________________________________________________________________________ MME 2003, Prague

Integer Programming and Logic-Based Modeling Jan Fábry, Jan Pelikán

  • Upload
    rob

  • View
    20

  • Download
    0

Embed Size (px)

DESCRIPTION

Integer Programming and Logic-Based Modeling Jan Fábry, Jan Pelikán. ___________________________________________________________________________ MME 2003, Prague. Integer Programming Models. Discrete variables: NP-hard problems. - PowerPoint PPT Presentation

Citation preview

Page 1: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

Integer Programming Integer Programming and and

Logic-Based ModelingLogic-Based Modeling

Jan Fábry, Jan PelikánJan Fábry, Jan Pelikán

___________________________________________________________________________MME 2003, Prague

Page 2: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Programming ModelsInteger Programming Models

Discrete variables: NP-hard problems

Non-polynomial method (exponentialnumber of branches)

Estimation of the optimal objective value

Standard Branch and Bound Method

Page 3: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Programming ModelsInteger Programming Models

Reduction of number of branches

Skiping non-effective branches (using the estimation of the optimal objective value)

Heuristic methods

Logic-based Branch and Bound Method

Page 4: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

TSP – IP ModelTSP – IP Model

,,...,2,1,1

osubject t

1

nixn

jij

n

i

n

jijij xcz

1 1

Minimize

,,...,2,1,11

njxn

iij

,,,...,3,2,,...,2,1,1 jinjninnxuu ijji

.,...,2,1,,1,0 njixij

Page 5: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

TSP – Logic-Based ModelTSP – Logic-Based Model

},{different -all

osubject t

1 n,y,y

n

kkykycz

11, Minimize

.,...,2,1 ny j

Page 6: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack Problem

Example:

3 objects

Cost = (5, 8, 4)

Profit = (3, 5, 2)

Value {1, 2, 3, 4}

All different

Feasible(4, 2, 1)

Infeasible(2, 2, 1)

Objective: minimize total cost

Total profit 30

Page 7: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack ProblemIP model

321 485 Minimize xxxz ,30253st 321 xxx

,3,2,1,4

1

ijyxj

iji

,3,2,1,14

1

iyj

ij

,4,3,2,1,13

1

jyi

ij

,3,2,1,41 ixi

.4,3,2,1,3,2,1,1,0 jiyij

321 485 Minimize xxxz ,30253st 321 xxx

,,,differentall 321 xxx

.3,2,1,4,3,2,1 jx j

Logic-based model

.otherwise0

,if1 jx

yi

ij

Page 8: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-based ApproachLogic-based Approach

Reduction of branches

Advantage

Simplicity of L-B models

Disadvantage No estimation of the optimal value

Page 9: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack Problem

Domain

VAR VALUE

x1 1 2 3 4

x2 1 2 3 4

x3 1 2 3 4

VAR VALUE

x1 2

x2 4

x3 3

VAR VALUE

x1 2

x2 2

x3 3

Page 10: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack Problem

Domain reduction

2,1, 21 xx 4,33 x

x1 1 2    

x2 1 2    

x3     3 4

Page 11: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack Problem

Bounds consistency maintenance

x1 1 2 3 4

x2 2 3 4

x3 1 2 3 4

30253 321 xxx

,3

24.24.530

3

12530

3

1321 xxx

,24.24.3305

12330

5

1312 xxx

.14.54.3302

15330

2

1213 xxx

Page 12: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Integer Knapsack ProblemInteger Knapsack Problem1 2 3 4  2 3 41 2 3 4

2  4

3

3 4  2 3 41 2 3 4

x1 ≤ 2 x1 ≥ 3

z = 54

4  3

2

3  41 2

x2 ≤ 3 x2 ≥ 4

z = 52

3  4

2

3  41

x3 ≤ 1 x3 ≥ 2

z = 51 z = 55

Page 13: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

all-different {y1,…,yn}

The domains of variables yj may have more than n elements.

The constraint requires that variables y1,…,yn take distinct values.

It is mostly used in assignment problems.

Page 14: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

circuit (y1,…,yn)

The constraint requires that yj is the integer occurring after j in some permutation of 1,2,…,n.

Used in vehicle routing applications.

.,...,1Each ny j

Page 15: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

path (y1,…,yk)

.and,...,1Each nkny j

Page 16: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

distribute ((m1,…,mn), (x1,…,xn), a)

The constraint requires that value of xj occurs exactly mj times in array a of an arbitrary length.

.,...,1Each nm j

Page 17: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

cumulative ((t1,…,tn), (d1,…,dn), (c1,…,cn), C)

Used in job scheduling problems.

Variable tj represents the start time of the job j.

Parameters dj and cj are the duration and the consuming resource rate of the job j.

The resource limit is C.

Page 18: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Logic-Based ModelingLogic-Based ModelingDefined predicates

element (y, (c1,…,cn), z)

The constraint requires that z = cy.

y and z are variables.

All cj are constants.

Used in lot-sizing problems.

Page 19: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

SoftwareSoftware

Standard Branch and Bound Method

LINGO, AMPL, XPRES-MP, ILOG CPLEX,…

Logic-based modeling

CHIP V5, OPBDP, ILOG Solver (OPL Studio),…

TRIAL VERSION:

http://www.ilog.com/products/oplstudio/trial.cfm

Page 20: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Mathematical Recreation Mathematical Recreation

JANDNESNEVIZDASE

JEDEJEDNAJIZDAZNOVA

enum Letters {J,A,E,N,D,S,V,I,Z,O}; var int k[Letters] in 0..9; solve { alldifferent(k) onDomain; 100*k[J]+10*k[A]+k[N] +1000*k[D]+100*k[N]+10*k[E]+k[S] +1000*k[N]+100*k[E]+10*k[V]+k[I] +100*k[Z]+10*k[D]+k[A] +10*k[S]+k[E] +1000*k[J]+100*k[E]+10*k[D]+k[E] +10000*k[J]+1000*k[E]+100*k[D]+10*k[N]+k[A] +10000*k[J]+1000*k[I]+100*k[Z]+10*k[D]+k[A] =10000*k[Z]+1000*k[N]+100*k[O]+10*k[V]+k[A]; k[J]>=1; k[D]>=1; k[N]>=1; k[Z]>=1; k[S]>=1; [J]<=5; };

Page 21: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Mathematical Recreation Mathematical Recreation

JANDNESNEVIZDASE

JEDEJEDNAJIZDAZNOVA

2013189185463098

2838283102463061750

10 solutions

Page 22: Integer Programming and  Logic-Based Modeling Jan Fábry, Jan Pelikán

___________________________________________________________________________Integer Programming and Logic-Based Modeling MME 2003, Prague

Questions