Re: [eclipse-clp-users] Knappsack-Problem Modification

From: Wit Jakuczun <wit.jakuczun_at_gmail.com>
Date: Tue, 13 Apr 2010 12:34:46 +0200
W dniu 2010-04-13 11:07, Philipp Marcus pisze:
> Do you see a possibility to take these not-passed distances in the VRP
> into account?
>    
Not easily. I missed the information you should measure also distances 
vehicles don't pass. I do not think that
with this constraint VRP is a good idea.
But I would start from the beginning. What exactly problem you have? :)

> What I've tried so far is the following that can be called by:
> assignItems([B1,B2,B3,B4,B5,B6],Measure)
>
>    
What is wrong with this solution? It seems to be ok (see below for small 
remarks).

>       Measure #= Measure1 + Measure2 + Measure3/3,
>    
Here you miss brackets...

>       branch_and_bound:minimize(labeling([B1,B2,B3,B4,B5,B6]),Measure).
>
> sigma(Items,Knappsack,Value) :-
>    
I understand this predicate calculates sum of dissimilarities of items 
belonging to knappsack Knappsack.
>               (Id1 #\= Id2 ->
>    
Id1 and Id2 are not CLP variables so you should use \== operator instead 
of #\=.

> dist(Id1,Id2,Dist) infers most,
"infers most" does not change anything here. Id1 and Id2 are atoms so 
Dist is uniquely determined.

Best regards

-- 
[ Wit Jakuczun http://pl.linkedin.com/in/jakuczunwit ]
Received on Tue Apr 13 2010 - 10:35:00 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET