[gecode-users] Newbie: space/solution copying & dynamically addedconstraints

Christian Schulte schulte at imit.kth.se
Thu Sep 21 11:40:23 CEST 2006


Hi Peter,

could you rephrase your issue with stop objects? I kind of miss the
problem... Sorry for that.

Christian

--
Christian Schulte, http://www.imit.kth.se/~schulte/ 

-----Original Message-----
From: Pieter Thysebaert [mailto:pthyseba at intec.ugent.be] 
Sent: Thursday, September 21, 2006 11:03 AM
To: Christian Schulte
Cc: 'Pieter Thysebaert'; users at gecode.org
Subject: RE: [gecode-users] Newbie: space/solution copying & dynamically
addedconstraints



Hi,

On Wed, 20 Sep 2006, Christian Schulte wrote:

> Hi Peter,
>
> looks interesting ;-)

....

> What you could do to make the search distributed is to cook up an 
> operation for a branching description that turns it into something 
> that can be send over the wire: should not be to hard, the typical 
> description contains just two integers. Then in order to hand out a 
> node, you just start from the same basic space and add all branching 
> descriptions corresponding to the path leading to the node you want to 
> explore (this is recomputation and looking how recomputation is done 
> in the search engines should give you an idea).

Well, for the time being, I'm distributing variable-range restrictions to
remote nodes as branching descriptions. I then construct a new problem
instance with these extra variable-range restrictions and start a new search
engine. The problem I had been bitten by previously (having difficulties in
passing dynamic information to the search) which presumably had to do with
copying spaces etc. has been "solved" by observing that I'm only running one
search engine per MPI process, so I can do with global variables (ugh).

> Much of the way search is done has been inherited from Mozart (apart 
> from batch recomputation). If you want to see an architecture for 
> distributed parallel search based on spaces, you might want to check:
> 	http://web.it.kth.se/~schulte/paper.html?id=Schulte:TRICS:2000
> or, if you prefer the full story:
> 	http://web.it.kth.se/~schulte/paper.html?id=Schulte:LNAI:2002

I might fall back to the worker/manager paradigm described there, as I
started out with a set of worker-peers (no central manager) but that might
be more difficult - less efficient.

> As it comes to pause resume, check 
> http://www.gecode.org/gecode-doc-latest/group__TaskIntSearchStop.html

Can you enlighten me: I've only used stop objects to, well, stop (i.e.
terminate) searches.

Suppose I'm in a loop like

do {
  solution* currentSolution = engine.next();
  statement;
}

For testing purposes, I have initialized the search engine with a custom
Stop object whose stop() function always returns true, and it turns out that
upon termination currentSolution becomes NULL.

I thought about implementing pause/restart by creating a new engine using
the last value of currentSolution as root node, but as currentSolution is
NULL upon termination of the search this seems impossible or is it not?

Pieter







More information about the gecode-users mailing list