5.202. max_index

DESCRIPTIONLINKSGRAPH
Origin

N. Beldiceanu

Constraint

max_index(MAX_INDEX,VARIABLES)

Argument(s)
MAX_INDEXdvar
VARIABLEScollection(indexint,vardvar)
Restriction(s)
|VARIABLES|>0
MAX_INDEX0
MAX_INDEX|VARIABLES|
required(VARIABLES,​​[index,var])
VARIABLES.index1
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,
index1var3,
index2var2,
index3var7,
index4var2,
index5var6
)

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

min_index.

Key words

characteristic of a constraint: maximum.

constraint type: order constraint.


Arc input(s)

VARIABLES

Arc generator
CLIQUEcollection(variables1,variables2)

Arc arity
2
Arc constraint(s)
variables1.key=variables2.keyvariables1.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

ctrs/max_indexActrs/max_indexB
(a) (b)