In discrete optimization, a special ordered set (SOS) is an ordered set of variables used as an additional way to specify integrality conditions in an optimization model. Special order sets are basically a device or tool used in branch and bound methods for branching on sets of variables, rather than individual variables, as in ordinary mixed integer programming. Knowing that a variable is part of a set and that it is ordered gives the branch and bound algorithm a more intelligent way to face the optimization problem, helping to speed up the search procedure. The members of a special ordered set individually may be continuous or discrete variables in any combination. However, even when all the members are themselves continuous, a model containing one or more special ordered sets becomes a discrete optimization problem requiring a mixed integer optimizer for its solution.

The ‘only’ benefit of using Special Ordered Sets compared with using only constraints is that the search procedure will generally be noticeably faster. As per J.A. Tomlin, Special Order Sets provide a powerful means of modeling nonconvex functions and discrete requirements, though there has been a tendency to think of them only in terms of multiple-choice zero-one programming.

Context of Applications 
 Multiple-choice programming
 Global Optimization with continuous separable functions.

History 
The origin of the concept was in the paper of Beale titled "Two transportation problems" (1963) where he presented a bid evaluation model. However, the term was first explicitly introduced by Beale and Tomlin (1970). The special order set were first implemented in Scicon's UMPIRE mathematical programming system.

Special Order sets were an important and recurring theme in Martin Beale's work, and their value came to be recognized to the point where nearly all production mathematical programming systems (MPS's) implement some version, or subset, of SOS.

Types of SOS 
There are two sorts of Special Ordered Sets:

 Special Ordered Sets of type 1 (SOS1 or S1): are a set of variables, at most one of which can take a non-zero value, all others being at 0. They most frequently apply where a set of variables are actually 0-1 variables: in other words, we have to choose at most one from a set of possibilities. These might arise for instance where we are deciding on what size of factory to build, when we have a set of options, perhaps small, medium, large or no factory at all, and if we choose to build a factory, we have to choose one and only one size.
 Special Ordered Sets of type 2 (SOS2 or S2): an ordered set of non-negative variables, of which at most two can be non-zero, and if two are non-zero these must be consecutive in their ordering. Special Ordered Sets of type 2 are typically used to model non-linear functions of a variable in a linear model. They are the natural extension of the concepts of Separable Programming, but when embedded in a Branch and Bound code enable truly global optima to be found, and not just local optima.

Further Example
 Example sizing a warehouse (Example for SOS Type 1 from Manual of ILOG CPLEX 11.2)

Notes

References 
 The notion of Special Ordered Sets was introduced by E. M. L. Beale and J. A. Tomlin. Special Facilities in a General Mathematical Programming System for Nonconvex Problems Using Ordered Sets of Variables. In J. Lawrence, editor, Operational Research 69, pages 447–454. Tavistock Publishing, London, 1970.
 E. M. L. Beale and J. J. H. Forrest. Global Optimization Using Special Ordered Sets. Mathematical Programming, 10(1):52–69, 1976.
 "Special Ordered Sets and an Application to Gas Supply Operations Planning", J.A. Tomlin, Ketron Management Science, Inc., Mountain View, CA 94040-1266, USA
 Christelle Gueret, Christian Prins, Marc Sevaus, "Applications of optimization with Xpress-MP", Editions Eyrolles, Paris, France (2000), , pag 39-42

Optimization of ordered sets
Optimization algorithms and methods