Duplicate columns error

  • 19 July 2019
  • 5 replies
  • 1145 views

Dear community,

When I try to solve the attached model, I get the following errors:

Warning: The columns "TransportToCustomer(Warehouse1,Customer5,038.001,1)" and "TransportToCustomer(Warehouse1,Customer399,038.001,1)" are equal in the generated mathematical program "LeastCostPlan". This may lead to non-unique solutions. For more information regarding potential causes and consequences, see the help associated with the option "Warning_duplicate_column".

Warning: Only 3 out of 11565909 duplicate column warnings were reported. See also option limit_reported_duplicate_column_row_warnings.

Warning: After zero iterations CPLEX 12.7.1 concluded that an integer solution to LeastCostPlan does not exist.

Firstly, I don't really what this error means. In the example above, the shipping of product 038.001 to Customer5 on Period 1 and the shipping of product 038.001 to customer 399 on Period 1 do not have anything to do with each other, other than that they originate from the same warehouse and that it is the same product.

I have come across one similar problem in the old Google Groups community here:
https://groups.google.com/forum/#!msg/aimms/X2Uu0oC-6w4/cgnvYrlkwJMJ

There, it was mentioned that this may be due to the use of double variables. However, I don't think any of them are present in this model. Could there be any other reason that this is happening, and how could I go about solving this problem?

Kind regards,

Koen

5 replies

Userlevel 4
Badge +4
The duplicate column messages are warnings. They are not the reason that CPLEX cannot find an integer solution (and declare the model as infeasible).

On second thought, the constraint ProductionLotsizeConstraint(f,p,t) can simply be formulated as:

code:
ProductionAllocation(f,p,t) >= MinimumSKULotsize(f)*ProductInFactory(f,p,t)


So, it does not have to be formulated as an indicator constraint.

Why is the model infeasible? You have the constraint ProductionCapacityConstraint(f,t) with definition:

code:
sum(p, ProductionAllocation(f,p,t)) <= ProductionCapacity(f,t)


On the other hand,

code:
sum(p, ProductionAllocation(f,p,t)) >= 
sum(p, MinimumSKULotsize(f)*ProductInFactory(f,p,t))


by constraint ProductionLotsizeConstraint(f,p,t), and therefore, taking constraint ProductInFactoryConstraint into account:

code:
sum(p, ProductionAllocation(f,p,t)) >= 
sum(p, MinimumSKULotsize(f)*ProductionCapability(p,f))


The value on the right can be calculated. For (t,p) = (Production3,2) it equals 9,550,000, which is higher than ProductionCapacity(Production3,2) = 8,736,000. Therefore, for (t,p) = (Production3,2) the constraint ProductionCapacityConstraint cannot be satisfied.

So it seems that ProductionCapacity(f,t) is too high for some (f,t), or MinimumSKULotsize(f) is too high, or too many ProductionCapability(p,f) are 1.

Regarding the duplicate column warnings. You get the warnings for TransportToCustomer for products for which there is no demand by a certain customer, for example customers 5 and 399 have no demand for product 038.001.

It seems to me that if a customer c does not demand product p then you do not have to transport that product to the customer, hence TransportToCustomer should then be 0. In that case you can use

code:
(w2,c,p,t) | CustomerDemand(c,p,t) > 0


as the index domain of variable TransportToCustomer. This will make the model much smaller, and resolve the duplicate column warnings.
Dear Marcel,

Thank you for your reply. However, some things are not clear to me.

I only have three constraints with regards to the production, namely:

code:
ProductionCapacityConstraint(f,t): 
sum(p, ProductionAllocation(f,p,t)) <= ProductionCapacity(f,t)


This constraint should state that for every factory and every time unit, the sum of all production of p should not exceed the production capacity. I believe that currently, this constraint is correctly formulated, but please correct me if I'm wrong.

The second constraint:

code:
ProductInFactoryConstraint(f,p,t)
ProductInFactory(f,p,t) - ProductionCapability(p,f) >= 0


This constraint should state that the binary variable ProductInFactory(f,p,t) can only be 1 if the factory f has the capability to produce product p. Again, I think this is correctly formulated but please correct me if I'm wrong.

The final constraint (changed as per your recommendation in the last comment):

code:
ProductionLotsizeConstraint(f,p,t)
ProductionAllocation(f,p,t) >= MinimumSKULotsize(f)*ProductInFactory(f,p,t)


In your second-to-last code box, you mention this:

code:
sum(p, ProductionAllocation(f,p,t)) >= 
sum(p, MinimumSKULotsize(f)*ProductionCapability(p,f))


However, it is not intended to be like this in the model, since the ProductionAllocation for every (f,p,t) should only be bigger than the MinimumSKULotsize(f).

Could you please explain to me how you've come to that conclusion? Because I'm not sure if I follow you correctly. Could you also let me know how you calculated this:

The value on the right can be calculated. For (t,p) = (Production3,2) it equals 9,550,000, which is higher than ProductionCapacity(Production3,2) = 8,736,000. Therefore, for (t,p) = (Production3,2) the constraint ProductionCapacityConstraint cannot be satisfied.


I realize that the ProductionCapacity(f,t) of Production3 is 8.736.000, like you said. But how did you come to the 9.550.000 that you mentioned, if the model itself is not able to solve? If it is by the code:

code:
sum(p, MinimumSKULotsize(f)*ProductionCapability(p,f))


Is there a way to change this equation? I am wondering, since I think my constraints individually should be correct, and right now I'm kind of losing the overview. I'm hoping that I explained the problem clear enough, and I hope you could help me.

Kind regards,

Koen
Userlevel 4
Badge +4
The constraint

code:
ProductInFactoryConstraint(f,p,t)
ProductInFactory(f,p,t) - ProductionCapability(p,f) >= 0


currently states that if ProductionCapability(p,f) is 1 then ProductInFactory(f,p,t) must be 1 which is stronger than can be 1. Which implication did you try to model?

If you meant the latter implication ("can be 1") then this constraint is not formulated correctly. This implication implies that ProductInFactory(f,p,t) must be 0 if ProductionCapability(p,f) is 0. The constraint should then be formulated as

code:
ProductInFactoryConstraint(f,p,t)
ProductInFactory(f,p,t) <= ProductionCapability(p,f)


Or even better, remove this constraint and use

code:
(f,p,t) | ProductionCapability(p,f) > 0


in the index domain of the variable ProductInFactory.
Dear Marcel,

Thank you very much! The model seems to solve now. However, there are still 2 small problems that I was wondering about:

  • The variable ProductionAllocation(f,p,t) is currently filled in, but the minimum lotsize constraint is not respected.
  • This is caused by the variable ProductInFactory(f,p,t) not being filled in. I was under the impression that a variable like this should be automatically filled in right? Or do I have to provide an additional reference for ProductInFactory that states that it must be 1 if ProductionAllocation > 1 ?
Kind regards,

Koen
Userlevel 4
Badge +4
You need a variable that links ProductionAllocation to ProductInFactory. You need something like a constraint C(f,t,p) with definition:

code:
ProductionAllocation(f,p,t) <= ProductionCapacity(f,t) * ProductInFactory(f,p,t)

It seems logical to me that ProductionAllocation(f,p,t) can only be greater than 0 if ProductInFactory(f,p,t) equals 1.

Reply


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

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