5.351. sliding_sum
DESCRIPTION | LINKS | GRAPH |
- Origin
CHIP
- Constraint
- Synonym
.
- Arguments
- Restrictions
- Purpose
Constrains all sequences of consecutive variables of the collection so that the sum of the variables belongs to interval .
- Example
-
The example considers all sliding sequences of consecutive values of collection and constraints the sum to be in . The constraint holds since the sum associated with the corresponding subsequences , , , and are respectively 7, 6, 5 and 7.
- Typical
- Symmetry
Items of can be reversed.
- Arg. properties
Contractible wrt. when .
Prefix-contractible wrt. .
Suffix-contractible wrt. .
- Algorithm
Beldiceanu and CarlssonΒ [BeldiceanuCarlsson01] have proposed a first incomplete filtering algorithm for the constraint. In 2008, Maher et al. showed inΒ [MaherNarodytskaQuimperWalsh08] that the constraint has a solution βif and only there are no negative cycles in the flow graph associated with the dual linear programβ that encodes the conjunction of inequalities. They derive a bound-consistency filtering algorithm from this fact.
- Systems
sliding_sum in MiniZinc.
- See also
common keyword: Β (sliding sequence constraint).
- Keywords
characteristic of a constraint: hypergraph, sum.
combinatorial object: sequence.
constraint type: decomposition, sliding sequence constraint, system of constraints.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
We use as an arc constraint. takes a collection of domain variables as its first argument.
PartsΒ (A) andΒ (B) of FigureΒ 5.351.1 respectively show the initial and final graph associated with the Example slot. Since all arc constraints hold (i.e.,Β because of the graph property ) the final graph corresponds to the initial graph.
Figure 5.351.1. (A)Β Initial and (B)Β final graph of the constraint of the Example slot where each ellipse represents an hyperedge involving vertices (e.g., the first ellipse represents the constraint )
- Signature
Since we use the arc generator with an arity of on the items of the collection, the expression corresponds to the maximum number of arcs of the final graph. Therefore we can rewrite the graph property to and simplify to .