Initializing help system before first use

problem.addSOS

Purpose
Creates a special ordered set (SOS) constraint within the problem.
Synopsis
s = problem.addSOS(indices, weights, type=1, name='')
Arguments
indices 
List of variables composing the SOS constraint.
weights 
List of weights (one per variable). These define the order for SOS2 constraints and may be used in branching for both types.
type 
Type of the SOS constraint. Can be 1 (default) or 2.
name 
Name of the SOS constraint.
Example
N = 20
p = xpress.problem()
x = [p.addVariable() for i in range(N)]
s1 = p.addSOS(x, [i+2 for i in range(N)])
s2 = p.addSOS([x[0], x[2]], [4,6])
Further information
Weights must be sufficiently distinct (see the SOSREFTOL control in the Optimizer manual). The addSOS function can also be used to add existing unlinked SOS constraints to a problem. This usage is deprecated. See xpress.sos for examples of using unlinked SOS constraints.

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