5.253. min_dist_between_inflexion

DESCRIPTIONLINKSAUTOMATON
Origin

Derived from πš’πš—πšπš•πšŽπš‘πš’πš˜πš—

Constraint

πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš—(π™Όπ™Έπ™½π™³π™Έπš‚πšƒ,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

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

Given an integer value π™Όπ™Έπ™½π™³π™Έπš‚πšƒ and a sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ enforce π™Όπ™Έπ™½π™³π™Έπš‚πšƒ to be greater than or equal to the smallest distance between two consecutive inflexions in the sequence πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚, or to |πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚| if no more than one inflexion exists.

An inflexion of a sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ is a set of consecutive variables V i ,V i+1 ,β‹―,V j-1 ,V j (i+1<j) such that one of the following conditions holds:

  • V i <V i+1 ∧V i+1 =β‹―=V j-1 ∧V j-1 >V j ,

  • V i >V i+1 ∧V i+1 =β‹―=V j-1 ∧V j-1 <V j .

In this context, the index j is the position of the inflexion (i.e., the first instant when the inflexion is discovered when scanning the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ from left to right. The distance between two consecutive inflexions is the absolute value of the difference of their corresponding positions.

Example
(2,2,2,3,3,2,2,1,4,4,3)

FigureΒ 5.253.1 shows the three inflexions associated with the sequence 2, 2, 3, 3, 2, 2, 1, 4, 4, 3 and their respective positions 5, 8 and 10 in red. The πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš— constraint holds since its first argument π™Όπ™Έπ™½π™³π™Έπš‚πšƒ=2 is greater than or equal to the smallest distance 2 between two consecutive inflexions of the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Figure 5.253.1. Illustration of the Example slot: a sequence of ten variables V 1 , V 2 , V 3 , V 4 , V 5 , V 6 , V 7 , V 8 , V 9 , V 10 respectively fixed to values 2, 2, 3, 3, 2, 2, 1, 4, 4, 3 and its three inflexions, two peaks and one valley; each red point denotes an instant where a new inflexion is discovered while scanning the sequence from left to right; as shown by the rightmost arrow, the minimum distance between two consecutive inflexions is equal to 2.
ctrs/min_dist_between_inflexion-1-tikz
Typical
π™Όπ™Έπ™½π™³π™Έπš‚πšƒ>1
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>3
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>1
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ can be reversed.

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

Counting
Length (n)2345678
Solutions96411352544457448313287476328156407

Number of solutions for πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš—: domains 0..n

ctrs/min_dist_between_inflexion-2-tikz

ctrs/min_dist_between_inflexion-3-tikz

Length (n)2345678
Total96411352544457448313287476328156407
Parameter
value

1--170359873794154351235152278
29-170469091098181976439992562
3-64170469097314193201241360676
4--625469097314196501242025560
5---777697314196501242192870
6----117649196501242192870
7-----209715242192870
8------43046721

Solution count for πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš—: domains 0..n

ctrs/min_dist_between_inflexion-4-tikz

ctrs/min_dist_between_inflexion-5-tikz

See also

common keyword: πš’πš—πšπš•πšŽπš‘πš’πš˜πš—, πš•πš˜πš—πšπšŽπšœπš_πšπšŽπšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšŽπššπšžπšŽπš—πšŒπšŽ, πš•πš˜πš—πšπšŽπšœπš_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšŽπššπšžπšŽπš—πšŒπšŽ, πš™πšŽπšŠπš”, πšŸπšŠπš•πš•πšŽπš’Β (sequence).

Keywords

characteristic of a constraint: automaton, automaton with counters, automaton with same input symbol.

combinatorial object: sequence.

constraint network structure: sliding cyclic(1) constraint network(3).

Automaton

FigureΒ 5.253.2 depicts the automaton associated with the πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš— constraint.

Figure 5.253.2. Automaton of the πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš— constraint (state s means that we are in stationary mode, state i0 means that we are in increasing mode and that we did not yet found any inflexion, state d0 means that we are in decreasing mode and that we did not yet found any inflexion, state i1 means that we are in increasing mode and that we already found at least one inflexion, state d1 means that we are in decreasing mode and that we already found at least one inflexion, the minimum distance between two consecutive inflexions is updated each time we switch from i1 to d1 mode – or conversely from d1 to i1 mode – and the counter D is updated accordingly)
ctrs/min_dist_between_inflexion-6-tikz
Figure 5.253.3. Hypergraph of the reformulation corresponding to the automaton of the πš–πš’πš—_πšπš’πšœπš_πš‹πšŽπšπš πšŽπšŽπš—_πš’πš—πšπš•πšŽπš‘πš’πš˜πš— constraint where πš… is a shortcut for πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ (since all states of the automaton are accepting there is no restriction on the last variable Q n-1 )
ctrs/min_dist_between_inflexion-7-tikz