Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

10
Universidad de Antofagasta, 2011 – Antofagasta, Chile Modelamiento Avanzado con Programación Entera Mixta Parte 2/3 Juan Pablo Vielma University of Pittsburgh 1 /27 2 3x 1 +2x 2 6 2x 1 + x 2 0 x 1 ,x 2 0 x 1 ,x 2 Z 0 1 1 x 1 x 2 2 0 2 3 min z := x 2 2 /27 2 3x 1 +2x 2 6 2x 1 + x 2 0 x 1 ,x 2 0 x 1 ,x 2 Z 0 1 1 x 1 x 2 2 0 2 3 min z := x 2 2 /27 2 3x 1 +2x 2 6 2x 1 + x 2 0 x 1 ,x 2 0 x 1 ,x 2 Z 0 1 1 x 1 x 2 2 0 2 3 (1) FRAC z=1.71 min z := x 2 2

Transcript of Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

Page 1: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

Universidad de Antofagasta, 2011 – Antofagasta, Chile

Modelamiento Avanzado!con Programación Entera Mixta

Parte 2/3

Juan Pablo Vielma

University of Pittsburgh

1/272

3x1+2x2 ≤ 6

−2x1+ x2 ≤ 0

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

min z := x2

2

/272

3x1+2x2 ≤ 6

−2x1+ x2 ≤ 0

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

min z := x2

2/272

3x1+2x2 ≤ 6

−2x1+ x2 ≤ 0

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

(1) FRACz=1.71

min z := x2

2

Page 2: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

/272

3x1+2x2 ≤ 6

−2x1+ x2 ≤ 0

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

(1) FRACz=1.71

min z := x2

(2) ENTEz=0

(3) FRACz=1.5

x1 ≤ 0 x1 ≥ 1

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

2/272

3x1+2x2 ≤ 6

−2x1+ x2 ≤ 0

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

(1) FRACz=1.71

min z := x2

(2) ENTEz=0

(3) FRACz=1.5

x1 ≤ 0 x1 ≥ 1

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

(5) INF(4) ENTEz=1

x1 ≤ 1 x2 ≥ 2

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

2

/273

x1, x2 ≥ 0

x1, x2 ∈ Z

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

min z := x2

x1+x2 ≤ 2

−2x1+x2 ≤ 0

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3

0 1

1

x1

x2

20

2

3 (1) FRACz=1.33

(2) ENTEz=0

(3) ENTEz=1

3/27

Que hace un Buen Modelo IP

Relajación lineal fuerte

Tamaño pequeño

Compatibilidad con ramificación de B&B...

4

Puedo tener una formulación fuerte y pequeña?

Si, usando el poder de las variables auxiliares (proyección)

4

Page 3: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

x1 + x2 ≤ 1

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

x1 + x2 ≤ 1

−x1 − x2 ≤ 1

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

Page 4: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

x1 + x2 ≤ 1

−x1 − x2 ≤ 1

+x1 − x2 ≤ 1

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

x1 + x2 ≤ 1

−x1 − x2 ≤ 1

+x1 − x2 ≤ 1

−x1 + x2 ≤ 1

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

Original Space: Size=O (2n)

�n

i=1sixi ≤ 1 ∀s ∈ {−1, 1}n

xi ∈ Z ∀i ∈ {1, . . . , n}

x1, x2 ∈ Z2

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2

x1 + x2 ≤ 1

−x1 − x2 ≤ 1

+x1 − x2 ≤ 1

−x1 + x2 ≤ 1

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

Original Space: Size=O (2n)

�n

i=1sixi ≤ 1 ∀s ∈ {−1, 1}n

xi ∈ Z ∀i ∈ {1, . . . , n}

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2 �n

i=1yi ≤ 1

−yi ≤ xi ≤ yi ∀i ∈ {1, . . . , n}xi ∈ Z ∀i ∈ {1, . . . , n}

O (n)Extended Formulation: Size=

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

5

Page 5: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

Original Space: Size=O (2n)

�n

i=1sixi ≤ 1 ∀s ∈ {−1, 1}n

xi ∈ Z ∀i ∈ {1, . . . , n}

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2 �n

i=1yi ≤ 1

−yi ≤ xi ≤ yi ∀i ∈ {1, . . . , n}xi ∈ Z ∀i ∈ {1, . . . , n}

O (n)Extended Formulation: Size=

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

Compact

5

Original Space: Size=O (2n)

�n

i=1sixi ≤ 1 ∀s ∈ {−1, 1}n

xi ∈ Z ∀i ∈ {1, . . . , n}

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2 �n

i=1yi ≤ 1

−yi ≤ xi ≤ yi ∀i ∈ {1, . . . , n}xi ∈ Z ∀i ∈ {1, . . . , n}

O (n)Extended Formulation: Size=

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

Large

Compact

5

Original Space: Size=O (2n)

�n

i=1sixi ≤ 1 ∀s ∈ {−1, 1}n

xi ∈ Z ∀i ∈ {1, . . . , n}

/27

IP Models

Dos tipos de formulaciones de PE

5

0 1-1

1

-1

x1

x2 �n

i=1yi ≤ 1

−yi ≤ xi ≤ yi ∀i ∈ {1, . . . , n}xi ∈ Z ∀i ∈ {1, . . . , n}

O (n)Extended Formulation: Size=

S :=�x ∈ Zn :�n

i=1|xi| ≤ 1

Large

Compact

?

5/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

maxx∈Zn

�n

i=1xi

6

Page 6: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

6/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

6

/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

6/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

6

Page 7: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

6/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1xi ≤ 1

6

/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1xi ≤ 1

6/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1xi ≤ 1

6

Page 8: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1xi ≤ 1

6/27

IP Models

Formulaciones Grandes: Separar

6

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1xi ≤ 1

6

/27

IP Models

La clave es separación rápida

7

0 1-1

1

-1

x1

x2 Initialize small rMIP

Separated?

Solve rMIP

Separate Optimal x

Add Cut

Yes

Done

No

x∗

−1 ≤ xi ≤ 1 ∀i ∈ {1, . . . , n}

maxx∈Zn

�n

i=1xi

�n

i=1sign(x∗

i )xi ≤ 1

7

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

Page 9: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

Page 10: Modelamiento Avanzado con Programación Entera Mixta Parte 2/3

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

88

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

8

\

Not Locally Ideal

LP has fractional extreme pt.

8

0 1 2 4

50

10

3240

15

(a) f .

epi(f)

0 1 2 4 x

50

10

3240

15

z

(b) epi(f).

Figure 3: A continuous piecewise linear function and its epigraph as the union of polyhedra.

= ∪ ∪ + +({2})

Figure 4: Epigraph of a continuous piecewise linear function as unions of polyhedra.

0 1 2 4 5

f(4) = 50

f(0) = 10

f(1) = 32

f(2) = 40

f(5) = 15

Figure 5: A continuous piecewise linear functions.

2

/26

Sharp pero no localmente ideal

8

\

Not Locally Ideal

LP has fractional extreme pt.

8