34
Mathematical Programming Luis Lafuente Center for Bits and Atoms Massachusetts Institute of Technology

Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Mathematical Programming

Luis LafuenteCenter for Bits and Atoms

Massachusetts Institute of Technology

Page 2: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Cellular Microcode

Hardware

Page 3: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

How to program a conformal computer?

Symmetries in Physics Global ⇔ Local

Symmetries in Conformal Computing

Global ⇔ Local

Variational principles

Euler-Lagrange Equations

Page 4: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

How to program a conformal computer?

Constraint Programming

Programs as a set of constraints between variablesNot good solvers

Page 5: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

How to program a conformal computer?

Constraint Programming

Mathematical Programming

Lagrange DualityConvex relaxationsDecomposition methods...

Programs as a set of constraints between variablesNot good solvers

Same philosophy, but GOOD solvers

ScalableDistributed

Page 6: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

How to program a conformal computer?

Constraint Programming

Mathematical Programming

Programs as a set of constraints between variablesNot good solvers

Local rules as distributed solutions of constrained global optimization problems

Page 7: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Optimization Theory and Convexity

“...the great watershed in optimization isn’t between linearity and nonlinearity, but convexity and nonconvexity.”

R. Tyrrell Rockafellar (SIAM Review, 2003)

Lagrange Duality Convex Relaxations

Dua

lPr

imal

C

Page 8: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Optimization Theory and Convexity

“...the great watershed in optimization isn’t between linearity and nonlinearity, but convexity and nonconvexity.”

R. Tyrrell Rockafellar (SIAM Review, 2003)

Lagrange Duality Convex Relaxations

Dua

lPr

imal

C

C!

Page 9: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Optimization Theory and Convexity

Decomposition framework

Dual decomposition (prices)Primal decomposition (resources)

Page 10: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Formulation

Preprocessing ➜ Objective function and constraints

Method ➜ Primal, dual, primal-dual, simplex, interior point, conjugated gradients, decomposition methods,...

Local Rules

Compiled program

High Level Language: Mathematical Programming

Page 11: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

Given a list of numbers

{u1, u2, . . . , uN}

find a permutation such that

u!(1) ! u!(2) ! . . . ! u!(N)

Optimization problem

fu : SN ! R! !" fu(!)

fu reaches the maximum when the permutation sorts the list

Page 12: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

maximize!N

i=1 i!N

j=1 Pijuj

subject to!N

j=1 Pij = 1, i = 1, . . . , N,!N

i=1 Pij = 1, j = 1, . . . , N,

Pij ! 0, i, j = 1, . . . , N.

Linear program

All the structure of the permutation is encoded on the constraints

DUALITY: Relax the original problem by transfering the constraints to the objective function

Convex relaxation

fu(!) = 1u!(1) + 2u!(2) + · · · + Nu!(N)

Page 13: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

Dual linear program

minimize!N

i=1 ri +!N

j=1 cj

subject to ri + cj ! iuj i, j = 1, . . . , N.

1

2

3

4

5

u1

u2

u3

u4

u5

Auction algorithm

Best value! vij! = maxj

(iuj " cj),

Second best value! wij! = maxj !=j!

(iuj " cj),

Bid! bi = pi + vij! " wij! + !

cj = maxi

bij ,

ij = arg maxi

bij ! Pij :=

!1, if i = ij ,

0, otherwise.

Bidding phase:

Assignment phase:

Page 14: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

Every permutation ! ! SN can be written as the product

! =N/2!

k=1

(1 1 + ck1)(3 3 + ck3) · · · (N " 1 N " 1 + ck N!1)

(2 2 + ck2)(4 4 + ck4) · · · (N " 1 N " 2 + ck,N!2),

where the cij ’s are 0 or 1, and (i i) = 12 . . . N

Theorem:

3412=(2 3)(1 2)(3 4)(2 3) ! c11 = c31 = 0, c12 = c21 = c23 = c22 = 1.

Example

Another approach(Permutation as a product of standard transpositions)

Page 15: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

Another approach(Permutation as a product of standard transpositions)

fu(!) = [1, 2, . . . , N ]EN/2ON/2 · · · E1O1! "# $P

u

Page 16: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

maximize fu(!) = [1, 2, . . . , N ]EN/2ON/2 · · · E1O1usubject to 0 ! ckl ! 1, k = 1, . . . , N/2, l = 1, . . . , N.

Gauss-Seidel iteration

O(t+1)k = arg min

O[1, 2, . . . , N ]E(t)

N/2O(t)N/2 · · · E(t)

k+1O(t)k+1E

(t)k! "# $

(t)

O E(t+1)k!1 O(t+1)

k!1 · · · E(t+1)1 O(t+1)

1! "# $(t+1)

u

E(t+1)k = arg min

E[1, 2, . . . , N ]E(t)

N/2O(t)N/2 · · · E(t)

k+1O(t)k+1! "# $

(t)

E O(t+1)k E(t+1)

k!1 O(t+1)k!1 · · · E(t+1)

1 O(t+1)1! "# $

(t+1)

u

Another approach(Permutation as a product of standard transpositions)

Convex Relaxation

Page 17: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

Sorting as a Mathematical Program

maximize fu(!) = [1, 2, . . . , N ]EN/2ON/2 · · · E1O1usubject to 0 ! ckl ! 1, k = 1, . . . , N/2, l = 1, . . . , N.

Another approach(Permutation as a product of standard transpositions)

Convex Relaxation

Page 18: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

Building blocks: Linear AlgebraMatrix multiplication, Cholesky, LU, QR, SVD,...

ScaLAPACK (Scalable LAPACK)

PLASMA (Parallel LA for Scalable Multi-core Architectures)

Page 19: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

Building blocks: Linear AlgebraMatrix multiplication, Cholesky, LU, QR, SVD,...

ScaLAPACK (Scalable LAPACK)

PLASMA (Parallel LA for Scalable Multi-core Architectures)

Parallel at the PROCESSOR level

Page 20: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

Building blocks: Linear AlgebraMatrix multiplication, Cholesky, LU, QR, SVD,...

ScaLAPACK (Scalable LAPACK)

PLASMA (Parallel LA for Scalable Multi-core Architectures)

Parallel at the PROCESSOR level

Parallel Linear Algebra in a Conformal Computer

Parallel at the BIT level

Page 21: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =x

!

"x1

x2

x3

#

$

Page 22: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Page 23: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Page 24: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Page 25: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Page 26: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 27: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 28: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 29: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 30: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 31: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 32: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 33: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

Page 34: Mathematical Programming - Massachusetts Institute of …cba.mit.edu/events/08.04.ASC/Lafuente.pdf · 2018-09-21 · Mathematical Programming Luis Lafuente Center for Bits and Atoms

General Optimization Solvers in the Boolean CA

“Rendering” Math

Linear time Matrix-Vector Multiplication

!

""#

a11 a12 a13

a21 a22 a23

a31 a32 a33

a41 a42 a43

$

%%&A =

x

! "x

1

x2

x3

# $

Prod

uct

Sum

m! n matrix m + n time