5.202. max_index
| DESCRIPTION | LINKS | GRAPH |
- Origin
N. Beldiceanu
- Constraint
max_index(MAX_INDEX,VARIABLES)
- Argument(s)
-
MAX_INDEX dvar VARIABLES collection(index−int,var−dvar) - Restriction(s)
-
|VARIABLES|>0 MAX_INDEX≥0 MAX_INDEX≤|VARIABLES| required(VARIABLES,[index,var]) VARIABLES.index≥1 VARIABLES.index≤|VARIABLES| distinct(VARIABLES,index) - Purpose
MAX_INDEX is the index of the variables corresponding to the maximum value of the collection of variables VARIABLES.
- Example
-
(
)3,〈
〉index−1 var−3, index−2 var−2, index−3 var−7, index−4 var−2, index−5 var−6 The attribute var=7 of the third item of the collection VARIABLES is the maximum value over values 3,2,7,2,6. Consequently, the max_index constraint holds since its first argument MAX_INDEX is set to 3.
- See also
- Key words
- Arc input(s)
VARIABLES
- Arc generator
-
CLIQUE↦collection(variables1,variables2) - Arc arity
-
2 - Arc constraint(s)
-
variables1.key=variables2.key∨variables1.var>variables2.var - Graph property(ies)
-
ORDER(0,0,index)=MAX_INDEX
- Graph model
Parts (A) and (B) of Figure 5.202.1 respectively show the initial and final graph associated with the Example slot. Since we use the ORDER graph property, the vertex of rank 0 (without considering the loops) of the final graph is outlined with a thick circle.
Figure 5.202.1. Initial and final graph of the max_index constraint


(a) (b)