Tobias Achterberg
unread,Jun 1, 2016, 4:55:10 PM6/1/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gur...@googlegroups.com
Hi Dinna,
the SOS weights are traditionally used to influence the branching strategy for
SOS constraints. Namely, when an SOS constraint is violated by the current LP
solution (for the case of SOS2 this means that there are two non-adjacent
variables with non-zero LP value), a branching split is performed that
partitions the variables of the SOS into two subsets and asks in the left child
node in the search tree to fix one part of the variables to zero, and in the
right child to fix the other part to zero. The SOS weights were a way to
influence how this partition is generated.
But note that Gurobi does not use the weights in this way. Gurobi always uses
its own internal procedure to split the SOS variables into two sets. The weights
are only used to specify the order of the variables. Thus, weights 0.1, 0.2,
..., 10.0 are really equivalent to 1, 2, ..., 100, or 1, 7, 15, ..., 8437 or
whatever numbers you want, as long as they are increasing. On the other hand, if
you specify weights like 3, 1, 2, 5, 4 it would mean that the variables are
reordered according to their weights. For SOS1 this is not important (SOS1
requires that at most one of the variables is non-zero, so the concept of
adjacency is not present), but for SOS2 the order is important.
So, in short, those weights are somewhat old-fashioned and a bit of an overkill
for the Gurobi API. Thus, setting the weights to the same values as the
breakpoints of the x coordinate is exactly what you want to do.
Best regards,
Tobias