[gecode-users] still looking for an example of path constraints

Guido Tack tack at gecode.org
Fri Nov 4 13:32:13 CET 2011


On 3 Nov 2011, at 22:23, serge lemouton wrote:

> Hello,
> 
> I have slightly modified the tsp example to test the path constraint by adding a "model" option to the script.
> No solution is found with the -model path option : why ?

Have a look at the documentation for path: succ[e]==succ.size(), so the domains must be 0..succ.size() instead of 0..succ.size()-1.

Cheers,
Guido

> Here is the modified code:
> 
> <tsp2.cpp>
> 
> Thanks for any hint,
> 
> Yours,
> 
> Serge
> 
> On 25 oct. 2011, at 23:58, serge lemouton wrote:
> 
>> Hello, 
>> 
>> I know that, and that is exactly what I was looking for !
>> But if it exists an hamiltonian circuit with n edges, it should exist at least n path with n-1 edges, right ?
>> and I don't know how to search those with the Gecode "path" constraint ...
>> Could you provide an example, please ?
>> 
>> Thanks in advance,
>> 
>> Serge
>> 
>> 
>> 
>> On 25 oct. 2011, at 14:07, Christian Schulte wrote:
>> 
>>> Hi,
>>> 
>>> Please check the meaning of path again in the documentation: it enforces a
>>> path and not a circuit!
>>> 
>>> Christian
>>> 
>>> --
>>> Christian Schulte, www.ict.kth.se/~cschulte/
>>> 
>>> 
>>> -----Original Message-----
>>> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
>>> Of serge lemouton
>>> Sent: Saturday, October 22, 2011 5:59 PM
>>> To: users at gecode.org
>>> Subject: [gecode-users] looking for an example of path constraints
>>> 
>>> Hi all,
>>> 
>>> I am trying to use the new path constraints with the cost matrix, but
>>> without any success, yet.
>>> 
>>> In the TSP example script, why simply replacing the  
>>> 
>>> 	circuit(*this, c, succ, costs, total, opt.icl());
>>> 		 by
>>> 	 path(*this, c, succ, start, end,costs, total, opt.icl());
>>> 
>>> does'nt find any solution ?
>>> 
>>> Thanks for any hint,
>>> 
>>> Serge Lemouton
>>> _______________________________________________
>>> Gecode users mailing list
>>> users at gecode.org
>>> https://www.gecode.org/mailman/listinfo/gecode-users
>>> 
>>> 
>> 
>> 
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org
>> https://www.gecode.org/mailman/listinfo/gecode-users
>> 
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/








More information about the users mailing list