The Weighted Average Constraint Alessio Bonfietti - - PowerPoint PPT Presentation

the weighted average constraint
SMART_READER_LITE
LIVE PREVIEW

The Weighted Average Constraint Alessio Bonfietti - - PowerPoint PPT Presentation

The Weighted Average Constraint Alessio Bonfietti <alessio.bonfietti@unibo.it> Michele Lombardi <michele.lombardi2@unibo.it> DEIS, University of Bologna Main Topic Paper topic: a global constraint for weighted average expressions P n


slide-1
SLIDE 1

The Weighted Average Constraint

Alessio Bonfietti <alessio.bonfietti@unibo.it> Michele Lombardi <michele.lombardi2@unibo.it> DEIS, University of Bologna

slide-2
SLIDE 2

average([Wi], [Vi], Y) ↔ Y = Pn−1

i=0 Wi · Vi

Pn−1

i=0 Wi

Main Topic

Paper topic: a global constraint for weighted average expressions

average([Wi], [Vi], Y) ↔ Y = round Pn−1

i=0 Wi · Vi

Pn−1

i=0 Wi

!

Equivalent for integer variables:

slide-3
SLIDE 3

Motivation

Context: workload dispatching for high performance computing Server room Multi-core Platforms

slide-4
SLIDE 4

Motivation

Context: workload dispatching for high performance computing § Jobs arrive in batches § Jobs are assigned to different machines/cores § Local scheduling (by the OS)

§ Obj: maximize worst core efficiency

Mapped Jobs Avg power temperature efficiency ... ...

slide-5
SLIDE 5

Motivation

Context: assignment problems with balancing issues customer (size = demand) facility (size = capacity) Single Source Capacitated Facility Problem

§ Assign customers to facility § Meet capacity constraints

...with Fair Travel Times

§ Balance the average travel time per facility

slide-6
SLIDE 6

Xi ∈ {0..m − 1} ∀i = 0. . . n − 1

Which Model?

Modeling Choices:

§ Assignment variables:

n = #customers/jobs m = #facilities/cores

POWER = Pn−1

i=0 (Xi = k) · poweri

Pn−1

i=0 (Xi = k)

TTIME = Pn−1

i=0 (Xi = k) · ttimei

Pn−1

i=0 (Xi = k)

Y = Pn−1

i=0 Wi · vi

Pn−1

i=0 Wi

§ For each facility/core k:

By abstracting a little bit:

slide-7
SLIDE 7

Which Model?

How do we model this expression?

n−1

X

i=0

Wi · vi = Y ·

n−1

X

i=0

Wi § Just post it!

Likely weak propagation...

Y = Pn−1

i=0 Wi · vi

w § Fixed denominator

sum constraint!

spread and deviation to improve filtering

Y = Pn−1

i=0 Wi · vi

Pn−1

i=0 Wi

slide-8
SLIDE 8

Y = Pn−1

i=0 Xi · vi

Pn−1

i=0 Xi

Which Model?

How do we model this expression?

average([Wi], [Vi], Y) § Otherwise, we need a new global constraint:

Here it is!

slide-9
SLIDE 9

Filtering

Spring equivalent: average as a bar pulled by metal spring

§ Weights Wi = spring thickness, Values vi = anchor points

slide-10
SLIDE 10
  • 3
  • 2
  • 1

1 2 3

V = [−3, 1, 1, 3] W0 = [0, 3] W1 = [1, 3] W2 = [1, 2] W3 = [0, 3]

Filtering

Spring equivalent: average as a bar pulled by metal spring

[0,3] [1,3] [1,2] [0,3]

dark light

§ Assumption 1: fixed values (adapted to variable Vi) § Assumption 2: continuous domains (adapted to integer domains)

Y

slide-11
SLIDE 11

Pruning the Average Variable

[0,3] [1,2] [0,3]

  • 3
  • 2
  • 1

1 2 3 [1,3]

§ Minimize all weights

Y upper bound = right-most position for the bar

§ Scan Wi from right to left

slide-12
SLIDE 12

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [0,3] [1,3]

vi > current avg

Pruning the Average Variable

§ Minimize all weights

Y upper bound = right-most position for the bar

§ Scan Wi from right to left § Maximize Wi if: § Repeat the process

UB = 1.8

§ WC complexity: O(n)

+ O(n log(n)) for the

  • rdering
slide-13
SLIDE 13

Y in [-1.80,-0.25] [0,3] [1,3] [1,2] [0,3]

  • 3
  • 2
  • 1

1 2 3

Pruning the Weight Variables

Wi upper bound = largest thickness so that the Y boundaries are not crossed

slide-14
SLIDE 14

[0,3] [1,2] [0,3]

  • 3
  • 2
  • 1

1 2 3 Y in [-1.80,-0.25] [1,3]

vi ≤ max(Y) vi > max(Y)

Pruning the Weight Variables

Wi upper bound = largest thickness so that the Y boundaries are not crossed

§ Maximize Wi if: § Minimize Wi if:

YMS max slack configuration

vi > max(Y) vi < max(Y) § UB if § LB if

slide-15
SLIDE 15

max slack configuration

[0,3] [1,2] [0,3]

  • 3
  • 2
  • 1

1 2 3 Y in [-1.80,-0.25] [1,3]

vi ≤ max(Y) vi > max(Y) vi > max(Y) vi < max(Y)

Pruning the Weight Variables

Wi upper bound = largest thickness so that the Y boundaries are not crossed

§ Maximize Wi if: § Minimize Wi if:

YMS

§ UB if § LB if

By solving: num(YMS) + (max(Wi) − min(Wi)) · vi

den(YMS) + (max(Wi) − min(Wi)) ≤ max(Y)

2.846

slide-16
SLIDE 16

max slack configuration

[0,3] [1,2] [0,3]

  • 3
  • 2
  • 1

1 2 3 Y in [-1.80,-0.25] [1,3]

vi ≤ max(Y) vi > max(Y) vi > max(Y) vi < max(Y)

Pruning the Weight Variables

Wi upper bound = largest thickness so that the Y boundaries are not crossed

§ Maximize Wi if: § Minimize Wi if:

YMS

§ UB if § LB if

2.846

§ WC complexity: O(n)

slide-17
SLIDE 17

Incremental Filtering

Problems of this class can grow pretty large:

§ Thermal Aware Workload Dispatching: 120 to 480 jobs § Fair Capacitated Facility Location: 50 customer, 16-50 locations

Incremental filtering can save a lot of computation time

§ Rules for the fixed values case § Particularly effective for {0,1} weights

slide-18
SLIDE 18

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [1,3] [2,3]

Incremental Filtering for the Y Variable

UB = 1.8

Store:

§ num(YUB)/den(YUB) § Index of the last maximized Wi

slide-19
SLIDE 19

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [1,3] [2,3]

When a weight changes: Store:

§ num(YUB)/den(YUB) § Index of the last maximized Wi

Incremental Filtering for the Y Variable

slide-20
SLIDE 20

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [2,3] [1,3]

When a weight changes: Store:

§ num(YUB)/den(YUB) § Index of the last maximized Wi § Update current avg

cur avg = 0.429

Incremental Filtering for the Y Variable

slide-21
SLIDE 21

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [2,3] [1,3]

When a weight changes: Store:

§ num(YUB)/den(YUB) § Index of the last maximized Wi § Update current avg

cur avg = 0.429

Incremental Filtering for the Y Variable

slide-22
SLIDE 22

[0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [2,3] [1,3] [0,3]

  • 3
  • 2
  • 1

1 2 3 [1,2] [2,3] [1,3]

When a weight changes: Store:

§ num(YUB)/den(YUB) § Index of the last maximized Wi § Update current avg § Maximize new Wi

UB = 0.5

§ No more than n shifts § No more than n ×

dom size updates

§ WC complexity

O(n × dom size)

Incremental Filtering for the Y Variable

slide-23
SLIDE 23

Experimental Results

Experiments on:

§ Capacitated Facility Location (max worst case average travel time) § Thermal aware workload dispatching: max worst case efficiency

Benchmarks:

§ Problem #1: Single Source instances by Beasley in the OR-Library § Problem #1: custom (publicly available) instances

Solution method (goal: testing constraint propagation):

§ Random restarts with fixed threshold § Random variable and value selection

Compare with competitor approaches

slide-24
SLIDE 24

Results for Capacitated Facility Location

!100.0%& !80.0%& !60.0%& !40.0%& !20.0%& 0.0%& 1& 3& 5& 10& 30& 60&

Decomposed)Average)

CAP6X& CAP7X& CAP9X& CAP10X& CAP12X& CAP13X&

slide-25
SLIDE 25

!100.00%& !80.00%& !60.00%& !40.00%& !20.00%& 0.00%& 1& 3& 5& 10& 30& 60&

Decomposed)Average)

M1&120& M1&240& M1&480& M2&120& M2&240& M2&480&

Results for Thermal Aware Dispatching

slide-26
SLIDE 26

!10.00%& !8.00%& !6.00%& !4.00%& !2.00%& 0.00%& 2.00%& 4.00%& 6.00%& 8.00%& 1& 3& 5& 10& 30& 60&

Decomposed)Average)

M1&120& M1&240& M1&480& M2&120& M2&240& M2&480&

Results for Thermal Aware Dispatching

slide-27
SLIDE 27

Conclusion

Main results

§ A global constraint for weighted average expressions § Useful for allocation problems with balancing components § (Incremental) Filtering algorithms

Future work directions

§ Apply incremental filtering ideas from the sum constraint § More application scenarios § Devise constraints for other classical inputs to machine learning

models

slide-28
SLIDE 28

Thanks!

Questions?

DEIS, University of Bologna

Funded by a grant