5.190. increasing_sum

DESCRIPTIONLINKS
Origin

Conjoin πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš and πšœπšžπš–_πšŒπšπš›.

Constraint

πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš‚)

Synonyms

πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–_πšŒπšπš›, πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–_𝚎𝚚.

Arguments
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
πš‚πšπšŸπšŠπš›
Restrictions
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)
Purpose

The variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are increasing. In addition, πš‚ is the sum of the variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Example
(3,3,6,8,20)

The πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš– constraint holds since:

  • The values of the collection 〈3,3,6,8βŒͺ are sorted in increasing order.

  • πš‚=20 is set to the sum 〈3+3+6+8βŒͺ.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>1
Arg. properties

Functional dependency: πš‚ determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Usage

The πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš– constraint can be used for breaking some symmetries in bin packing problems. Given a set of n bins with the same maximum capacity, and a set of items each of them with a specific height, the problem is to pack all items in the bins. To break symmetry we order bins by increasing use. This is done by introducing a variable x i (0≀i<n) for each bin i giving its use, i.e.,Β the sum of items heights assigned to bin i, and by posting the following πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(〈x 0 ,x 1 ,β‹―,x n-1 βŒͺ,s) where s denotes the sum of the heights of all the items to pack.

Algorithm

A linear time filtering algorithm achieving bound-consistency for the πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš– constraint is described inΒ [PetitReginBeldiceanu11]. This algorithm was motivated by the fact that achieving bound-consistency on the inequality constraints and on the sum constraint independently hinders propagation, as illustrated by the following small example, where the maximum value of x 1 is not reduced to 2: x 1 ∈[1,3], x 2 ∈[2,5], s∈[5,6], x 1 <x 2 , x 1 +x 2 =s.

Given an πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(〈x 0 ,x 1 ,β‹―,x n-1 βŒͺ,s) constraint, the bound-consistency algorithm consists of three phases:

  1. A normalisation phase adjusts the minimum and maximum value of variables x 0 ,x 1 ,β‹―,x n-1 with respect to the chain of inequalities x 0 ≀x 1 ≀⋯≀x n-1 . A forward phase adjusts the minimum value of x 1 ,x 2 ,β‹―,x n-1 (i.e.,Β x i+1 Μ²β‰₯x i Μ²), while a backward phase adjusts the maximum value of x n-2 ,x n-1 ,β‹―,x 0 (i.e.,Β x i-1 ¯≀x i Β―).

  2. A phase restricts the minimum and maximum value of the sum variable s with respect to the chain of inequalities x 0 ≀x 1 ≀⋯≀x n-1 (i.e.,Β s Μ²β‰₯βˆ‘ 0≀i<n x i Μ² and s Β―β‰€βˆ‘ 0≀i<n x i Β―).

  3. A final phase reduces the minimum and maximum value of variables x 0 ,x 1 ,β‹―,x n-1 both from the bounds of s and from the chain of inequalities. Without loss of generality we now focus on the pruning of the maximum value of variables x 0 ,x 1 ,β‹―,x n-1 . For this purpose we first need to introduce the notion of last intersecting index of a variable x i , denoted by π‘™π‘Žπ‘ π‘‘ i . This corresponds to the greatest index in [i+1,n-1] such that x i Β―>x π‘™π‘Žπ‘ π‘‘ i Μ², or i if no such integer exists. Then the increase of the minimum value of s when x i is equal to x i Β― is equal to βˆ‘ k∈[i,π‘™π‘Žπ‘ π‘‘ i ] (x i Β―-x k Μ²). When this increase exceeds the available margin, i.e.Β s Β―-βˆ‘ 0≀i<n x i Μ², we update the maximum value of x i .

We illustrate a part of the final phase on the following example πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(〈x 0 ,x 1 ,x 2 ,x 3 ,x 4 ,x 5 βŒͺ,s), where x 0 ∈[2,6], x 1 ∈[4,7], x 2 ∈[4,7], x 3 ∈[5,7], x 4 ∈[6,9], x 5 ∈[7,9] and s∈[28,29]. Observe that the domains are consistent with the first two phases of the algorithm, since,

  1. the minimum (and maximum) values of variables x 0 ,x 1 ,x 2 ,x 3 ,x 4 ,x 5 are increasing,

  2. the sum of the minimum of the variables x 0 ,x 1 ,x 2 ,x 3 ,x 4 ,x 5 , i.e., 28 is less than or equal to the maximum value of s,

  3. the sum of the maximum of the variables x 0 ,x 1 ,x 2 ,x 3 ,x 4 ,x 5 , i.e., 45 is greater than or equal to the minimum value of s.

Now, assume we want to know the increase of the minimum value of s when x 0 is set to its maximum value 6. First we compute the last intersecting index of variable x 0 . Since x 4 is the last variable for which the minimum value is less than or equal to maximum value of x 0 we have π‘™π‘Žπ‘ π‘‘ 0 =4. The increase is equal to βˆ‘ k∈[0,4] (x 0 Β―-x k Μ²)=(6-2)+(6-4)+(6-4)+(6-5)+(6-6)=9. Since it exceeds the margin 29-(2+4+4+5+6+7)=1 we have to reduce the maximum value of x 0 . How to do this incrementally is described inΒ [PetitReginBeldiceanu11].

Counting
Length (n)2345678
Solutions62070252924343212870

Number of solutions for πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–: domains 0..n

ctrs/increasing_sum-1-tikz

ctrs/increasing_sum-2-tikz

Length (n)2345678
Total62070252924343212870
Parameter
value

01111111
11111111
22222222
31333333
41355555
5-357777
6-379111111
7-2711131515
8-1814182022
9-1716222628
10--718283438
11--519324248
12--520395363
13--320426377
14--219487597
15--1185187116
16--11655100141
17---1455112164
18---1158125194
19---955136221
20---755146255
21---551155284
22---348162319
23---242166348
24---139169383
25---132169409
26----28166440
27----22162461
28----18155486
29----13146499
30----11136515
31----7125519
32----5112526
33----3100519
34----287515
35----175499
36----163486
37-----53461
38-----42440
39-----34409
40-----26383
41-----20348
42-----15319
43-----11284
44-----7255
45-----5221
46-----3194
47-----2164
48-----1141
49-----1116
50------97
51------77
52------63
53------48
54------38
55------28
56------22
57------15
58------11
59------7
60------5
61------3
62------2
63------1
64------1

Solution count for πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–: domains 0..n

ctrs/increasing_sum-3-tikz

ctrs/increasing_sum-4-tikz

See also

common keyword: πšœπšžπš–_πšŒπšπš›Β (sum).

implies: πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš.

Keywords

characteristic of a constraint: sum.

constraint type: predefined constraint, order constraint, arithmetic constraint.

filtering: bound-consistency.

modelling: functional dependency.

symmetry: symmetry.

Cond. implications

β€’ πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš‚)

Β Β Β  withΒ  πš–πš’πš—πšŸπšŠπš•(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>0

Β Β implies πšŠπšπš–πš˜πšœπš_πš—πšŸπšŠπš•πšžπšŽ(πš‚,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚).

β€’ πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšžπš–(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš‚)

Β Β Β  withΒ  πš–πš’πš—πšŸπšŠπš•(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>0

Β Β implies πšœπšžπš–_𝚘𝚏_πš’πš—πšŒπš›πšŽπš–πšŽπš—πšπšœ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,π™»π™Έπ™Όπ™Έπšƒ).