Initializing help system before first use

xpress.sos

Purpose
Python object class for Special Order Sets (SOS). An SOS is a modeling tool for constraining a small number of consecutive variables in a vector to be nonzero.
Synopsis
s = xpress.sos(indices, weights, type=1, name='')
Arguments
indices 
List of variables composing the SOS.
weights 
List of weights (one per variable).
type 
Type of SOS. Can be 1 (default) or 2.
name 
Name of the SOS.
Example
The following are example declarations of SOS:
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, "mysos")
One or more SOS can be added to a problem via the 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 ([xpr.sos([w[i],w[i+1]], [2,3], type=2) for i in range(n-1)])
Related topics

© 2001-2022 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.