Initializing help system before first use

Special Ordered Sets (SOSs)

A Special Order Set (SOS) is a modeling tool for constraining a small number of consecutive variables in a vector to be nonzero. The Xpress Python interface allows for defining a SOS as follows:

sos (indices, weights, type, name)

The first argument, indices, is a list of variables, while weights is a list of floating point numbers. The type of SOS (either 1 or 2) is specified by type. While indices and weights are mandatory parameters, type and name are not; type is set to a default of 1 when not specified. Examples follow:

set1 = xp.sos (x, [0.5 + i*0.1 for i in range(10)], type = 2)
set2 = xp.sos ([y[i] for i in range(5)], [i+1 for i in range(5)])
set3 = xp.sos ([v1, v2], [2, 5], 2)

One or more SOS can be added to a problem via the problem.addSOS method:

set1 = xp.sos (x, [0.5 + i*0.1 for i in range(10)], type = 2)
m.addSOS (set1)
n = 10
w = [xp.var () for i in range (n)]
m.addSOS ([xp.sos ([w[i],w[i+1]], [2,3], type = 2) for i in range (n-1)])

The name member of a SOS object can be read and written by the user.

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.