AnsweredAssumed Answered

How to handle set of strings in Xpress?

Question asked by julian_0113@hotmail.com on May 5, 2016
Latest reply on May 9, 2016 by julian_0113@hotmail.com

Hi,

 

I am currently working on a proyect related to Vehicle Routing problem.

I have the following set of string:

A={"P1", "P2", "P3", "P4","P5","P6"…}

B={"K1", "K2", "K3", "K4",…}

C={"F1", "F2", "F3", "F4",…}

 

The sets B and C have the same size

My mpvar is X(i,j,k)

What I need is to compare the positions of this string, eg:

sum(i in A) X(i,"F1","K1")=1

sum(i in A) X(i,"F2","K2")=1

sum(i in A) X(i,"F3","K3")=1 .

.

.

.

 

What i first tried was

forall(j in B,k in C|j=k) sum(i in A)X(i,j,k)

It didn’t work because the elements of B will never be equal to the elements of C.

Please I do really need help with this, I am kind of new with Xpress.

 

Thanks

Outcomes