[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fd_vector_max/1

From: Daniel Diaz
Subject: Re: fd_vector_max/1
Date: Tue, 22 Feb 2011 09:56:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

Hello Nicolas,

The current implementation of FD variables uses of a bit-vector to represent sparse values. This vector is used as soon as "holes" appear in the domain of a variable. The current implementation uses a fixed-length vector whose length is controlled via the fd_vector_max/1 predicate. This choice has been done for efficiency reasons. Other representations are possible but 1) imply a lot of code rewriting in the solver and 2) will penalize efficiency.

In your case (IP addr) it is obviously not a good idea to use a bit-vector for 2^32 values (and in fact you cannot define a so big length) ! Use instead 4 different variables ranging in 0..255 (or 2 variables in 0..65535) and "link" them by constraints.


Le 22/02/2011 08:12, Nicolas Pelletier a écrit :

I would like to know how difficult it would be to lift the restriction
that the maximum length for vector representation of FD variables is
fixed, and what the expected impact on general performance would be. I
am generating the configuration of a network equipment based on
constraints on the functions that must be activated (and some other
constraints on their respective configurations as well). Parts of the
configuration constrain the domains of the variables used in other
parts as some functions cannot be used together, or reserve some
resources, such as IP address ranges. Some of my FD variables
represent such ranges, and can sometimes span a big chunk of IP
addresses. I am reluctant to split these into several FD variables,
each spanning only 256 addresses or so, as this would make the program
more complex and error-prone, but I am also concerned by the waste of
memory I would incur if I were to set fd_vector_max to a huge value;
hence my question.

Thank you in advance for any answers.

Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]