Opened 3 years ago

Closed 3 months ago

#9 closed defect (migrated)

Issues using Special Ordered Sets

Reported by: kurtzb Owned by: somebody
Priority: high Milestone:
Component: component1 Version:
Severity: blocker Keywords: SOS
Cc:

Description

I seem to be having an issue with Special Ordered Sets of Type 1 and Type 2. When you set up an SOS of Type 1 or Type 2 and one of the variables in the set has a cost in the objective of 0, CoinMP fails to find an optimal solution.

Below are examples model in LP Solve format. (I had to use LP Solve since it appears the output to MPS in CoinMP also does not print the SOS constraint types).

It is possible that the code I am using is doing something incorrect when constructing the model, but it does work when there are all non-zero costs in the objective row.

/*SOS Type 1 Working Model+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* Objective function */
min: +C1 +5 C2 +5 C3 +10 C4;

/* Constraints */
R1: +C1 <= 10;
R2: +C2 <= 25;
R3: +C3 <= 25;
R4: +C4 <= 35;
+C1 +C2 +C3 +C4 >= 35;

/* SOS definitions */
SOS
5: C1:0,C2,C3,C4 <= 1:4;


/*SOS Type 1 Non-working Model+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* Objective function */
min: +5 C2 +5 C3 +10 C4;

/* Constraints */
R1: +C1 <= 10;
R2: +C2 <= 25;
R3: +C3 <= 25;
R4: +C4 <= 35;
+C1 +C2 +C3 +C4 >= 35;

/* SOS definitions */
SOS
5: C1:0,C2,C3,C4 <= 1:4;


/*SOS Type 2 Working Model+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* Objective function */
min: +C1 +C2 +30 C3 +30 C4 +C5 +C6;

/* Constraints */
R1: +C1 <= 30;
R2: +C2 <= 4;
R3: +C3 <= 25;
R4: +C4 <= 10;
R5: +C5 <= 14;
R6: +C6 <= 20;
+C1 +C2 +C3 +C4 +C5 +C6 >= 35;

/* SOS definitions */
SOS
7: C1:0,C2,C3,C4,C5,C6 <= 2:6;

/*SOS Type 2 Non-working Model+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* Objective function */
min: +C2 +30 C3 +30 C4 +C5 +C6;

/* Constraints */
R1: +C1 <= 30;
R2: +C2 <= 4;
R3: +C3 <= 25;
R4: +C4 <= 10;
R5: +C5 <= 14;
R6: +C6 <= 20;
+C1 +C2 +C3 +C4 +C5 +C6 >= 35;

/* SOS definitions */
SOS
7: C1:0,C2,C3,C4,C5,C6 <= 2:6;

Thanks!

Change History (1)

comment:1 Changed 3 months ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be resolved there: https://github.com/coin-or/CoinMP/issues/9

Note: See TracTickets for help on using tickets.