Skip to main content
Solved

How to solve duplicate column error

  • February 22, 2024
  • 1 reply
  • 48 views

May I know how to solve the duplicate column error since I have put the Xconstraint(i,l,g,g0) so that duplicate column does not occur? Whoever is the sender Q(i,l,g,g0) of the product cannot be the same one who is receiving the product Q(i,l,g0,g) to satisfy the local demand. May I know if there is any other way to solve this problem instead of using the constraint such as X(i,l,g,g0) + X(i,l,g0,g) <= 1 since the system does not apply this constraint at all?

Best answer by Chris Kuip

The constraint XConstraint:

Constraint XConstraint {
    IndexDomain: (i,l,g,g0) |g<>g0;
    Definition: X(i,l,g,g0)+X(i,l,g0,g)<=1;
}
When for index values g= 'g1’, g0='g2’ the same row is generated as when g= 'g2’, g0='g1’; the warning issued is justified.

To avoid generating the same row in this situation, the index domain condition 'g <> g0’ can be changed to 'g < g0’

 

 

1 reply

Chris Kuip
AIMMSian
Forum|alt.badge.img+7
  • AIMMSian
  • 125 replies
  • Answer
  • March 29, 2024

The constraint XConstraint:

Constraint XConstraint {
    IndexDomain: (i,l,g,g0) |g<>g0;
    Definition: X(i,l,g,g0)+X(i,l,g0,g)<=1;
}
When for index values g= 'g1’, g0='g2’ the same row is generated as when g= 'g2’, g0='g1’; the warning issued is justified.

To avoid generating the same row in this situation, the index domain condition 'g <> g0’ can be changed to 'g < g0’

 

 



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator