5.249. maximum

DESCRIPTIONLINKSGRAPHAUTOMATON
Origin

CHIP

Constraint

πš–πšŠπš‘πš’πš–πšžπš–(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Synonym

πš–πšŠπš‘.

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

π™Όπ™°πš‡ is the maximum value of the collection of domain variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Example
(7,3,2,7,2,6)
(1,0,0,1,0,1)

The first πš–πšŠπš‘πš’πš–πšžπš– constraint holds since its first argument π™Όπ™°πš‡=7 is fixed to the maximum value of the collection 〈3,2,7,2,6βŒͺ.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>1
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • All occurrences of two distinct values of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be swapped.

  • One and the same constant can be added to π™Όπ™°πš‡ as well as to the πšŸπšŠπš› attribute of all items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Arg. properties
  • Functional dependency: π™Όπ™°πš‡ determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

  • Aggregate: π™Όπ™°πš‡(πš–πšŠπš‘), πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚(πšžπš—πš’πš˜πš—).

Usage

In some project scheduling problems one has to introduce dummy activities that correspond for instance to the completion time of a given set of activities. In this context one can use the πš–πšŠπš‘πš’πš–πšžπš– constraint to get the maximum completion time of a set of tasks.

Remark

Note that πš–πšŠπš‘πš’πš–πšžπš– is a constraint and not just a function that computes the maximum value of a collection of variables: potential values of π™Όπ™°πš‡ influence the variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚, and reciprocally potential values that can be assigned to variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ influence π™Όπ™°πš‡.

The πš–πšŠπš‘πš’πš–πšžπš– constraint is called πš–πšŠπš‘ in JaCoP (http://www.jacop.eu/).

Algorithm

A filtering algorithm for the πš–πšŠπš‘πš’πš–πšžπš– constraint is described inΒ [Beldiceanu01].

The πš–πšŠπš‘πš’πš–πšžπš– constraint is entailed if all the following conditions hold:

  1. π™Όπ™°πš‡ is fixed.

  2. At least one variable of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ is assigned value π™Όπ™°πš‡.

  3. All variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ have their maximum value less than or equal to value π™Όπ™°πš‡.

Counting
Length (n)2345678
Solutions9646257776117649209715243046721

Number of solutions for πš–πšŠπš‘πš’πš–πšžπš–: domains 0..n

ctrs/maximum-1-tikz

ctrs/maximum-2-tikz

Length (n)2345678
Total9646257776117649209715243046721
Parameter
value

01111111
137153163127255
25196521166520596305
3-3717578133671419758975
4--36921011152961741325089
5---4651310312018111288991
6----709935436074085185
7-----127360911012415
8------26269505

Solution count for πš–πšŠπš‘πš’πš–πšžπš–: domains 0..n

ctrs/maximum-3-tikz

ctrs/maximum-4-tikz

Systems

max in Choco, max in Gecode, max in JaCoP, maximum in MiniZinc, maximum in SICStus.

See also

common keyword: πš–πš’πš—πš’πš–πšžπš–Β (order constraint).

comparison swapped: πš–πš’πš—πš’πš–πšžπš–.

generalisation: πš–πšŠπš‘πš’πš–πšžπš–_πš–πš˜πšπšžπš•πš˜Β (πšŸπšŠπš›πš’πšŠπš‹πš•πšŽ replaced by πšŸπšŠπš›πš’πšŠπš‹πš•πšŽ mod πšŒπš˜πš—πšœπšπšŠπš—πš).

implied by: πš˜πš›.

implies: πš‹πšŽπšπš πšŽπšŽπš—_πš–πš’πš—_πš–πšŠπš‘, πš’πš—.

soft variant: πš˜πš™πšŽπš—_πš–πšŠπš‘πš’πš–πšžπš–Β (open constraint).

specialisation: πš–πšŠπš‘_πš—Β (maximum or order πš— replaced by absolute maximum).

uses in its reformulation: πšπš›πšŽπšŽ_πš›πšŠπš—πšπšŽ.

Keywords

characteristic of a constraint: maximum, automaton, automaton without counters, reified automaton constraint.

constraint arguments: reverse of a constraint, pure functional dependency.

constraint network structure: centered cyclic(1) constraint network(1).

constraint type: order constraint.

filtering: glue matrix, arc-consistency, entailment.

modelling: balanced assignment, functional dependency.

Cond. implications

πš–πšŠπš‘πš’πš–πšžπš–(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Β Β Β  withΒ  πšπš’πš›πšœπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)<π™Όπ™°πš‡

Β Β Β  andΒ Β  πš•πšŠπšœπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)<π™Όπ™°πš‡

Β Β implies πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš”(π™·π™΄π™Έπ™Άπ™·πšƒ,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚).

Arc input(s)

πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚

Arc generator
πΆπΏπΌπ‘„π‘ˆπΈβ†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1,πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2)

Arc arity
Arc constraint(s)
β‹πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1.πš”πšŽπš’=πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2.πš”πšŽπš’,πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1.πšŸπšŠπš›>πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2.πšŸπšŠπš›
Graph property(ies)
πŽπ‘πƒπ„π‘(0,π™Όπ™Έπ™½π™Έπ™½πšƒ,πšŸπšŠπš›)=π™Όπ™°πš‡

Graph model

We use a similar definition that the one that was utilised for the πš–πš’πš—πš’πš–πšžπš– constraint. Within the arc constraint, we replace the comparison operator < by >.

PartsΒ (A) andΒ (B) of FigureΒ 5.249.1 respectively show the initial and final graph associated with the first example of the Example slot. Since we use the πŽπ‘πƒπ„π‘ graph property, the vertex of rank 0 (without considering the loops) of the final graph is outlined with a thick circle.

Figure 5.249.1. Initial and final graph of the πš–πšŠπš‘πš’πš–πšžπš– constraint
ctrs/maximumActrs/maximumB
(a) (b)
Automaton

FigureΒ 5.249.2 depicts the automaton associated with the πš–πšŠπš‘πš’πš–πšžπš– constraint. Let πš…π™°πš i be the i th variable of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection. To each pair (π™Όπ™°πš‡,πš…π™°πš i ) corresponds a signature variable S i as well as the following signature constraint: (π™Όπ™°πš‡>πš…π™°πš i ⇔S i =0) ∧(π™Όπ™°πš‡=πš…π™°πš i ⇔S i =1) ∧(π™Όπ™°πš‡<πš…π™°πš i ⇔S i =2).

Figure 5.249.2. Counter free automaton of the πš–πšŠπš‘πš’πš–πšžπš– constraint
ctrs/maximum-5-tikz
Figure 5.249.3. Hypergraph of the reformulation corresponding to the automaton of the πš–πšŠπš‘πš’πš–πšžπš– constraint
ctrs/maximum-6-tikz

FigureΒ 5.249.3 depicts a second counter free non deterministic automaton associated with the πš–πšŠπš‘πš’πš–πšžπš– constraint, where the argument π™Όπ™°πš‡ is also part of the sequence passed to the automaton.

Figure 5.249.4. Counter free non deterministic automaton of the πš–πšŠπš‘πš’πš–πšžπš–(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚) constraint assuming that the union of the domain of the variables is the set {1,2,3,4} and that the elements of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are first passed to the automaton followed by π™Όπ™°πš‡ (state s i means that no value strictly greater than value i was found and that value i was already encountered at least once)
ctrs/maximum-7-tikz
Figure 5.249.5. Hypergraph of the reformulation corresponding to the counter free non deterministic automaton of the πš–πšŠπš‘πš’πš–πšžπš– constraint
ctrs/maximum-8-tikz

FigureΒ 5.249.6 depicts a third deterministic automaton with one counter associated with the πš–πšŠπš‘πš’πš–πšžπš– constraint, where the argument π™Όπ™°πš‡ is unified to the final value of the counter.

Figure 5.249.6. Automaton (with one counter) of the πš–πšŠπš‘πš’πš–πšžπš– constraint and its glue constraint
ctrs/maximum-9-tikz
Figure 5.249.7. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the πš–πšŠπš‘πš’πš–πšžπš– constraint: since all states variables Q 0 ,Q 1 ,β‹―,Q n are fixed to the unique state s of the automaton, the transitions constraints share only the counter variable C and the constraint network is Berge-acyclic
ctrs/maximum-10-tikz