5.24. among_diff_0

DESCRIPTIONLINKSGRAPHAUTOMATON
Origin

Used in the automaton of πš—πšŸπšŠπš•πšžπšŽ.

Constraint

πšŠπš–πš˜πš—πš_πšπš’πšπš_0(π™½πš…π™°πš,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

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

π™½πš…π™°πš is the number of variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ that take a value different from 0.

Example
(3,0,5,5,0,1)
(0,0,0,0,0,0)
(1,0,0,0,6,0)

The first πšŠπš–πš˜πš—πš_πšπš’πšπš_0 constraint holds since exactly 3 values of the collection of values 〈0,5,5,0,1βŒͺ are different from 0.

Typical
π™½πš…π™°πš>0
π™½πš…π™°πš<|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
πšŠπšπš•πšŽπšŠπšœπš(1,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,0)
2*πšŠπš–πš˜πš—πš_πšπš’πšπš_0(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • An occurrence of a value of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› that is different from 0 can be replaced by any other value that is also different from 0.

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

  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™½πš…π™°πš=0.

  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™½πš…π™°πš=|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|.

  • Aggregate: π™½πš…π™°πš(+), πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚(πšžπš—πš’πš˜πš—).

Counting
Length (n)2345678
Solutions9646257776117649209715243046721

Number of solutions for πšŠπš–πš˜πš—πš_πšπš’πšπš_0: domains 0..n

ctrs/among_diff_0-1-tikz

ctrs/among_diff_0-2-tikz

Length (n)2345678
Total9646257776117649209715243046721
Parameter
value

01111111
1491625364964
24279625054010291792
3-27256125043201200528672
4--25631251944084035286720
5---3125466563529471835008
6----466568235437340032
7-----82354316777216
8------16777216

Solution count for πšŠπš–πš˜πš—πš_πšπš’πšπš_0: domains 0..n

ctrs/among_diff_0-3-tikz

ctrs/among_diff_0-4-tikz

See also

common keyword: πš—πšŸπšŠπš•πšžπšŽΒ (counting constraint).

generalisation: πšŠπš–πš˜πš—πšΒ (πšŸπšŠπš›πš’πšŠπš‹πš•πšŽβ‰ 0 replaced by πšŸπšŠπš›πš’πšŠπš‹πš•πšŽβˆˆπšŸπšŠπš•πšžπšŽπšœ).

Keywords

characteristic of a constraint: joker value, automaton, automaton with counters.

constraint arguments: pure functional dependency.

constraint network structure: alpha-acyclic constraint network(2).

constraint type: value constraint, counting constraint.

filtering: arc-consistency.

modelling: functional dependency.

Arc input(s)

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

Arc generator
π‘†πΈπΏπΉβ†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ)

Arc arity
Arc constraint(s)
πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ.πšŸπšŠπš›β‰ 0
Graph property(ies)
𝐍𝐀𝐑𝐂=π™½πš…π™°πš

Graph model

Since this is a unary constraint we employ the 𝑆𝐸𝐿𝐹 arc generator in order to produce an initial graph with a single loop on each vertex.

PartsΒ (A) andΒ (B) of FigureΒ 5.24.1 respectively show the initial and final graph associated with first example of the Example slot. Since we use the 𝐍𝐀𝐑𝐂 graph property, the loops of the final graph are stressed in bold.

Figure 5.24.1. Initial and final graph of the πšŠπš–πš˜πš—πš_πšπš’πšπš_0 constraint
ctrs/among_diff_0Actrs/among_diff_0B
(a) (b)
Automaton

FigureΒ 5.24.2 depicts the automaton associated with the πšŠπš–πš˜πš—πš_πšπš’πšπš_0 constraint. To each variable πš…π™°πš i of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ corresponds a 0-1 signature variable S i . The following signature constraint links πš…π™°πš i and S i : πš…π™°πš i β‰ 0⇔S i . The automaton counts the number of variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection that take a value different from 0 and finally assigns this number to π™½πš…π™°πš.

Figure 5.24.2. Automaton of the πšŠπš–πš˜πš—πš_πšπš’πšπš_0 constraint
ctrs/among_diff_0-5-tikz
Figure 5.24.3. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the πšŠπš–πš˜πš—πš_πšπš’πšπš_0 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/among_diff_0-6-tikz