Originally posted by: SystemAdmin
Dear forum,
I would like to implement a constraint propagator in CP Optimizer that takes advantage of a particular graph structure. Analogous to a network flow based propagator, this graph needs to be updated each time some domain changes. Ideally this would be done in an incremental fashion, but there would be no problem to just copy this structure when a new search node is created, and modify this particular copy instead. However, it would be too computationally expensive to create it from scratch for every new search node.
Checking the documentation and previous questions to this forum, I came across reversible types (IlcRev*) for Solver and noticed that they are also available in CP Optimizer. My doubt is as follows: Is there any efficient way to implement this behavior (copying the graph for each new search node or any incrementality methods) using reversible types? (I know that in the previous CP Solver version I could use IlcIntSet for an adjacent list representation, but this does not seem to be available anymore.)
I have already implemented a very first idea using IlcRevAny, where for each daemon call I would copy my structure, setting it as the new value for my IlcRevAny type. However, when the solver backtracks, I lost the reference to the copies and ran into memory issues, since I could not deallocate it. Is it possible to change this behavior for the reversible procedure, perhaps by inheriting some of its related class and overriding some method? Would you have any other kind suggestions?
It would also be ideal if this is transparent to the search method, since the CP Optimizer default search works very well for my problem.
Thank you very much,
Andre
#CPOptimizer#DecisionOptimization