PySCIPOpt  4.3.0
Python Interface for the SCIP Optimization Suite
flp-benders Namespace Reference

Functions

def flp (I, J, d, M, f, c)
 
def make_data ()
 

Variables

 c
 
list customers = ["c%s"%i for i in d]
 
 d
 
list edges = [(i,j) for (i,j) in x if subprob.getVal(x[i,j]) > EPS]
 
int EPS = 1.e-6
 
 f
 
list facilities = [j for j in y if master.getVal(y[j]) > EPS]
 
 G = NX.Graph()
 
 I
 
 J
 
 M
 
 master
 
 node_color
 
 nodelist
 
list other = [j for j in y if j not in facilities]
 
 position = NX.drawing.layout.spring_layout(G)
 
 subprob
 
 suby
 
 x
 
 y = master.data
 

Function Documentation

◆ flp()

def flp-benders.flp (   I,
  J,
  d,
  M,
  f,
  c 
)
flp -- model for the capacitated facility location problem
Parameters:
    - I: set of customers
    - J: set of facilities
    - d[i]: demand for customer i
    - M[j]: capacity of facility j
    - f[j]: fixed cost for using a facility in point j
    - c[i,j]: unit cost of servicing demand point i from facility j
Returns a model, ready to be solved.

Definition at line 12 of file flp-benders.py.

References pyscipopt.expr.quicksum().

◆ make_data()

def flp-benders.make_data ( )
creates example data set

Definition at line 61 of file flp-benders.py.

References pyscipopt.Multidict.multidict().

Variable Documentation

◆ c

c

Definition at line 76 of file flp-benders.py.

◆ customers

list customers = ["c%s"%i for i in d]

Definition at line 115 of file flp-benders.py.

◆ d

d

Definition at line 76 of file flp-benders.py.

◆ edges

list edges = [(i,j) for (i,j) in x if subprob.getVal(x[i,j]) > EPS]

Definition at line 95 of file flp-benders.py.

◆ EPS

int EPS = 1.e-6

Definition at line 90 of file flp-benders.py.

◆ f

f

Definition at line 76 of file flp-benders.py.

◆ facilities

list facilities = [j for j in y if master.getVal(y[j]) > EPS]

Definition at line 92 of file flp-benders.py.

◆ G

G = NX.Graph()

Definition at line 112 of file flp-benders.py.

◆ I

I

Definition at line 76 of file flp-benders.py.

◆ J

J

Definition at line 76 of file flp-benders.py.

◆ M

M

Definition at line 76 of file flp-benders.py.

◆ master

master

Definition at line 77 of file flp-benders.py.

◆ node_color

node_color

Definition at line 123 of file flp-benders.py.

◆ nodelist

nodelist

Definition at line 123 of file flp-benders.py.

◆ other

list other = [j for j in y if j not in facilities]

Definition at line 114 of file flp-benders.py.

◆ position

position = NX.drawing.layout.spring_layout(G)

Definition at line 122 of file flp-benders.py.

◆ subprob

subprob

Definition at line 77 of file flp-benders.py.

◆ suby

suby

Definition at line 94 of file flp-benders.py.

◆ x

x

Definition at line 94 of file flp-benders.py.

◆ y

y = master.data

Definition at line 91 of file flp-benders.py.