5.359. soft_alldifferent_ctr

DESCRIPTIONLINKSGRAPH
Origin

[PetitReginBessiere01]

Constraint

𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš›(𝙲,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Synonyms

𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπš_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšœπšπš’πš—πšŒπš_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπš_πš–πš’πš—_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πš–πš’πš—_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšœπšπš’πš—πšŒπš_πš–πš’πš—_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πšŠπš‘_πšŒπšπš›.

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

Consider the disequality constraints involving two distinct variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚[i].πšŸπšŠπš› and πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚[j].πšŸπšŠπš› (i<j) of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚. Among the previous set of constraints, 𝙲 is greater than or equal to the number of disequality constraints that do not hold.

Example
(4,5,1,9,1,5,5)
(1,5,1,9,1,2,6)
(0,5,1,9,0,2,6)

Within the collection 〈5,1,9,1,5,5βŒͺ the first and fifth values, the first and sixth values, the second and fourth values, and the fifth and sixth values are identical. Consequently, the argument 𝙲=4 is greater than or equal to the number of disequality constraints that do not hold (i.e,Β 4) and the 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš› constraint holds.

Typical
𝙲>0
𝙲≀|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|*(|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|-1)/2
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
Symmetries
  • 𝙲 can be increased.

  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • All occurrences of two distinct values of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be swapped; all occurrences of a value of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be renamed to any unused value.

Arg. properties

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

Usage

A soft πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš constraint.

Remark

The 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš› constraint is called 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπš_πš–πš’πš—_πšŒπšπš› or 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πšŠπš‘_πšŒπšπš› inΒ [HebrardMarxSullivanRazgon09].

Algorithm

Since it focus on the soft aspect of the πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš constraint, the original articleΒ [PetitReginBessiere01] that introduces this constraint describes how to evaluate the minimum value of 𝙲 and how to prune according to the maximum value of 𝙲. The corresponding filtering algorithm does not achieve arc-consistency. W.-J.Β vanΒ HoeveΒ [Hoeve04] presents a new filtering algorithm that achieves arc-consistency. This algorithm is based on a reformulation into a minimum-cost flow problem.

Counting
Length (n)2345678
Solutions152083625725761630279406323201114431777

Number of solutions for 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš›: domains 0..n

ctrs/soft_alldifferent_ctr-1-tikz

ctrs/soft_alldifferent_ctr-2-tikz

Length (n)2345678
Total152083625725761630279406323201114431777
Parameter
value

0624120720504040320362880
19604804320428404636805443200
2-60540612080640116928018144000
3-646207320100590158088027881280
4--6207620113190193368036666000
5--6207620113190196896039206160
6--6257770116760205128041111280
7---7770117390208656042522480
8---7770117390208656042628320
9---7770117390208852042769440
10---7776117642209557642938784
11----117642209675243023456
12----117642209675243025976
13----117642209675243030008
14----117642209675243030008
15----117649209714443044120
16-----209714443046136
17-----209714443046136
18-----209714443046136
19-----209714443046136
20-----209714443046136
21-----209715243046712
22------43046712
23------43046712
24------43046712
25------43046712
26------43046712
27------43046712
28------43046721

Solution count for 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš›: domains 0..n

ctrs/soft_alldifferent_ctr-3-tikz

ctrs/soft_alldifferent_ctr-4-tikz

See also

common keyword: 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πšŠπš‘_πšŸπšŠπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πš’πš—_πšŒπšπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πš’πš—_πšŸπšŠπš›, 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŸπšŠπš›Β (soft constraint).

hard version: πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš.

implied by: πšŽπššπšžπš’πšŸπšŠπš•πšŽπš—πš, πš’πš–πš™πš•πš’.

implies: 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŸπšŠπš›.

related: πšŠπšπš–πš˜πšœπš_πš—πšŸπšŠπš•πšžπšŽ.

Keywords

characteristic of a constraint: all different, disequality.

constraint type: soft constraint, value constraint, relaxation, decomposition-based violation measure.

filtering: minimum cost flow.

modelling: degree of diversity of a set of solutions.

modelling exercises: degree of diversity of a set of solutions.

Arc input(s)

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

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

Arc arity
Arc constraint(s)
πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1.πšŸπšŠπš›=πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2.πšŸπšŠπš›
Graph property(ies)
𝐍𝐀𝐑𝐂≀𝙲

Graph model

We generate an initial graph with binary equalities constraints between each vertex and its successors. We use the arc generator πΆπΏπΌπ‘„π‘ˆπΈ(<) in order to avoid counting twice the same equality constraint. The graph property states that 𝙲 is greater than or equal to the number of equalities that hold in the final graph.

PartsΒ (A) andΒ (B) of FigureΒ 5.359.1 respectively show the initial and final graph associated with the Example slot. Since we use the 𝐍𝐀𝐑𝐂 graph property, the arcs of the final graph are stressed in bold. Since four equality constraints remain in the final graph the cost variable 𝙲 is greater than or equal to 4.

Figure 5.359.1. Initial and final graph of the 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπšπš› constraint
ctrs/soft_alldifferent_ctrActrs/soft_alldifferent_ctrB
(a) (b)