[gecode-users] Cost for values in domain

Tales Pinheiro de Andrade tales at talesp.inf.br
Thu Nov 25 20:49:09 CET 2010


Sorry, I sent the message below with wrong mail account.

Begin forwarded message:

Date: 25 November 2010 4:48:17 PM
To: users at gecode.org
Subject: Cost for values in domain

Hi, all

First, sorry about the bad English.

I'm searching in MPG.pdf, but still didn't find anything.

Is it possible to give cost to values in domain? I have n variables, each one with integer domain = {-1, 0, 1}. But I want to give costs for each value in each domain, and minimize the cost of the selection, obeying some other constrints.

For example: for variables z, y, z, the costs for values {-1, 0, 1} are:

Cx = {50, 20, 30}
Cy = {30, 40, 30}
Cz = {60, 20, 20}

And I want to select x, y, z minimizing Cx + Cy + Cz.

I first tought in create a bool variable for each cost in each variable. So I would get 3X more variables, with contraint that only one shoul be true. And do something like this: maximize

b_1x*c_1x + b_2x*c_2x + b_3x*c_3x + 
b_1y*c_1y + b_2y*c_2y + b_3y*c_3y + 
b_1z*c_1z + b_2z*c_2z + b_3z*c_3z

Is there a better way to do this?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20101125/f4ea46df/attachment.htm>


More information about the users mailing list