Add a Special Ordered Set (SOS) constraint to an lpSolve linear program model object.
add.SOS(lprec, name, type, priority, columns, weights)
If the operation was successful: a single integer value containing the list index of the new special ordered set. A return value of 0
indicates an error.
an lpSolve linear program model object.
a character string specifying a name for the SOS constraint.
a positive integer specifying the type of the SOS constraint.
an integer specifying the priority of the SOS constraint.
a numeric vector of unique values from the set {1, ..., n}
(where n
is the number of decision variables in lprec
) indicating which decision variables belong to the special ordered set.
a numeric vector the same length as columns
specifying the variable weights.
Kjell Konis kjell.konis@me.com