[gecode-users] constraint graphs via boolvars
Martin Mann
mmann at informatik.uni-freiburg.de
Wed May 31 15:28:56 CEST 2006
Greetings,
I m currently thinking about an implementation of a more or less
bruteforce implementation of a binary constraint graph. my idea is like
that:
1) i ve got an array of n IntVars = D[0..n-1]
2) a BoolVar derived subclass EdgeVar manages 2 indices in (0..n-1) in
addition to the normal BoolVar data
3) for each binary constraint c I introduce an EdgeVar connected to a
corresponding reified constraint
4) i create an adjacency list to represent the constraint graph
so far no prob..
now i want that:
- if an EdgeVar becomes assigned, i remove the corresponding entries
from the adjancency list
thats the point I m currently stucked ..
whats the best way to do?
theoretically the constraint graph and therefor the adjacency list is an
n-ary constraint over the EdgeVars. So my first idea is to derive the
adjecency list from Gecode::Propagator, to get notified of the
assignments... but cant find a way to subscribe this "global" constraint
to the EdgeVars.
currently i build the complete adjacency list from the EdgeVar objects,
everytime i need the constraint graph. but i think thats nothing
effective.. :)
hope you can help and have an idea
Martin
More information about the gecode-users
mailing list