[Gecode] Improved integer domain representation
Christian Schulte
schulte at imit.kth.se
Tue Nov 18 17:12:00 CET 2003
Dear all,
I improved the representation of integer domains. They are now implenmented
using a bidirectional list. This gives the following complexity:
<=, >= O(n) and O(1) amortized
!=, == O(n)
narrow O(m) (where m is number of ranges for
iterator argument)
inter, minus O(n+m)
In addition, for != and == the number of iterations performed is n/2 (in
average).
As you have seen I also have renamed the domain operations involving range
iterators:
narrow(Iterator& i) replaces the current domain of the variable
with the ranges as defined by i,
the ranges for I must define a
subset of the current domain
inter(Iterator& i) intersection of current domain with I
minus(Iterator& i) remove ranges from current domain as defined
by I
What still needs to be done is to make the iterators take advantage of the
biderectional representation of integer domains. But I think I will not have
any time in the short fututure.
Cheers
Christian
--
Christian Schulte, http://www.imit.kth.se/~schulte/
More information about the gecode-users
mailing list