PySCIPOpt  4.3.0
Python Interface for the SCIP Optimization Suite
piecewise Namespace Reference

Functions

def convex_comb_agg (model, a, b)
 
def convex_comb_agg_log (model, a, b)
 
def convex_comb_dis (model, a, b)
 
def convex_comb_dis_log (model, a, b)
 
def convex_comb_sos (model, a, b)
 
def gray (i)
 
def mult_selection (model, a, b)
 

Variables

list a = [ -10, 10, 15, 25, 30, 35, 40, 45, 50, 55, 60, 70]
 
 A = model.addCons(3*X + 4*Y <= 250, "A")
 
list b = [ -20,-20, 15, -21, 0, 50, 18, 0, 15, 24, 10, 15]
 
 B = model.addCons(7*X - 2*Y + 3*u == 170, "B")
 
 model = Model("multiple selection")
 
 u = model.addVar(vtype="C", name="u")
 
 w
 
 X
 
 Y
 
 z
 

Function Documentation

◆ convex_comb_agg()

def piecewise.convex_comb_agg (   model,
  a,
  b 
)
convex_comb_agg -- add piecewise relation convex combination formulation -- non-disaggregated.
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 149 of file piecewise.py.

References pyscipopt.expr.quicksum().

◆ convex_comb_agg_log()

def piecewise.convex_comb_agg_log (   model,
  a,
  b 
)
convex_comb_agg_log -- add piecewise relation with a logarithmic number of binary variables
using the convex combination formulation -- non-disaggregated.
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 178 of file piecewise.py.

References gray(), and pyscipopt.expr.quicksum().

◆ convex_comb_dis()

def piecewise.convex_comb_dis (   model,
  a,
  b 
)
convex_comb_dis -- add piecewise relation with convex combination formulation
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 73 of file piecewise.py.

References pyscipopt.expr.quicksum().

◆ convex_comb_dis_log()

def piecewise.convex_comb_dis_log (   model,
  a,
  b 
)
convex_comb_dis_log -- add piecewise relation with a logarithmic number of binary variables
using the convex combination formulation.
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 105 of file piecewise.py.

References pyscipopt.expr.quicksum().

◆ convex_comb_sos()

def piecewise.convex_comb_sos (   model,
  a,
  b 
)
convex_comb_sos -- add piecewise relation with gurobi's SOS constraints
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 49 of file piecewise.py.

References pyscipopt.expr.quicksum().

◆ gray()

def piecewise.gray (   i)
returns i^int(i/2)

Definition at line 100 of file piecewise.py.

◆ mult_selection()

def piecewise.mult_selection (   model,
  a,
  b 
)
mult_selection -- add piecewise relation with multiple selection formulation
Parameters:
    - model: a model where to include the piecewise linear relation
    - a[k]: x-coordinate of the k-th point in the piecewise linear relation
    - b[k]: y-coordinate of the k-th point in the piecewise linear relation
Returns the model with the piecewise linear relation on added variables X, Y, and z.

Definition at line 18 of file piecewise.py.

References pyscipopt.expr.quicksum().

Variable Documentation

◆ a

list a = [ -10, 10, 15, 25, 30, 35, 40, 45, 50, 55, 60, 70]

Definition at line 223 of file piecewise.py.

◆ A

A = model.addCons(3*X + 4*Y <= 250, "A")

Definition at line 232 of file piecewise.py.

◆ b

list b = [ -20,-20, 15, -21, 0, 50, 18, 0, 15, 24, 10, 15]

Definition at line 224 of file piecewise.py.

◆ B

B = model.addCons(7*X - 2*Y + 3*u == 170, "B")

Definition at line 233 of file piecewise.py.

◆ model

model = Model("multiple selection")

Definition at line 227 of file piecewise.py.

◆ u

u = model.addVar(vtype="C", name="u")

Definition at line 230 of file piecewise.py.

◆ w

w

Definition at line 268 of file piecewise.py.

◆ X

X

Definition at line 228 of file piecewise.py.

◆ Y

Y

Definition at line 228 of file piecewise.py.

◆ z

z

Definition at line 228 of file piecewise.py.