ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created...

20
MPL-LE.1 n m b i i c j j a ij i j MPL-LE.2 j=1,n c j x j j=1,n a ij x j b i i m x j j = n

Transcript of ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created...

Page 1: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.1

n

m

bi i

cj j

aij i j

MPL-LE.2

j=1,n cj xj

j=1,n aij xj bi i m

xj j = n

Page 2: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.3

nmcj =

bi = aij =

MPL-LE.4

/* file CPLEX, formato LP */

Page 3: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.5

for ( j = 1; j <= n; j++ ) fprintf(fout, “+%d x%d “,a[i,j],j);fprintf(fout, “ >= %d \n”,b[i] );

}fprintf(fout,”END\n”);fclose(fout);

}

MPL-LE.6

Page 4: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.7

MPL-LE.8

Page 5: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.9

MPL-LE.10

Page 6: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.11

MPL-LE.12

DATAMODEL

MPL

SOLVER

Page 7: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.13

MPL-LE.14

Page 8: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.15

MPL-LE.16

Page 9: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.17

MPL-LE.18

Page 10: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.19

nutrients:= ;

foods:=

foods:=

->

MPL-LE.20

Page 11: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.21

MPL-LE.22

Page 12: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.23

MPL-LE.24

Page 13: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.25

MPL-LE.26

MinP:=

Required[nutrients] :=

Required1Required2 Required3 Required4 Required5Required6 Required7 Required8.

Page 14: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.27

A[foods,nutrients]:=DATAFILE(”input.dat");

A [foods,nutrients]=

EXCELRANGE(”input.xls",”foods");

MPL-LE.28

Page 15: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.29

MPL-LE.30

X[foods]

MultiVar[foods,nutrients] -> Y

Page 16: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.31

INTEGER.

BINARY.

INTEGER VARIABLES

MultiVar[foods,nutrients];

MPL-LE.32

Page 17: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.33

MIN MAX;

x1 x2

foods:cost*x

Cost foods,nutrients Y

MPL-LE.34

plain constraintsX 1 + X2 + X3

vector constraintsnutrients

foods:A*x required nutrients

Page 18: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.35

vector constraints

nutrients

foods nutrients

foods bread

MPL-LE.36

xj x(j+1) x(j+k) a

jh j j+k x a

j+k j kx x x x x x a

kkkk x j+kk a

Page 19: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.37

x1 MinP;

y_bound: < Y(1,1) < ;

MPL-LE.38

Page 20: ilp mpl - unibo.it · 2004. 1. 22. · Microsoft PowerPoint - ilp_mpl.ppt Author: alodi Created Date: 1/22/2004 7:01:08 PM ...

MPL-LE.39