Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Sos2 Operator (Solver Foundation)
Collapse the table of content
Expand the table of content

Sos2 Operator (Solver Foundation)

Solver Foundation 3.0

Adds an SOS2 constraint.

Sos2[args]

Sos2[function_decision == point_0*set_member_0 + ... + point_n*set_member_n]
Sos2[point_0 * set_member_0 + ... + point_n * set_member_n]
Model[
  Decisions[Reals[0, Infinity], x, p1, p2, p3, y],
  Constraints[
    // x is constrained to be greater than or equal to 1.5
    x>=1.5,
    // The value of function y in point 1 is 1, in point 2 is 3, and 
    // in point 3 is 4
    y == p1 + 3*p2 + 4*p3,
    // 1, 2 and, 3 are the points where the function value is known
    Sos2[x == 1*p1 + 2*p2 + 3 * p3]
  ],
  Goals[ Minimize[y] ]
]

Show:
© 2015 Microsoft