[ library(gfd) | Reference Manual | Alphabetic Index ]

get_weighted_degree(?Var, -WD)

Returns the weighted degree of domain variable Var.
Var
A domain variable
WD
Current wighted degree for variable

Description

Returns the weighted degree for a domain variable. Weighted degree is the original name used in the literature for this measure, ans is known as AFC (accumulated failure count) in Gecode, and is usually used as a criterion for selecting a variable for labelling.

The weighted degree is a floating point, due to Gecode's extension of the basic weighted degree measure: weighted degree for a variable is defined as the count of the failures so far of the constraints (propagators) associated with the variable, plus an initial value that is proportional to the variable's degree (number of associated constraints) -- to give reasonable initial values. The degree proportionality can be non-integral but is by default one (i.e. the default initial value for the weighted degree of a variable is its degree), but can be changed by init_weighted_degree/1. In addition, the failure count for a constraint can decay if the constraint was not involved in the failure. The rate of decay can be set by set_weighted_degree_decay/1 (the default is 1 -- no decay).

Modes and Determinism

See Also

set_weighted_degree_decay / 1, init_weighted_degree / 1