PySCIPOpt  4.3.0
Python Interface for the SCIP Optimization Suite
kmedian.py File Reference

model for solving the k-median problem. More...

Go to the source code of this file.

Namespaces

 kmedian
 

Functions

def distance (x1, y1, x2, y2)
 
def kmedian (I, J, c, k)
 
def make_data (n, m, same=True)
 

Variables

 c
 
 client = set(i for i in I if i not in facilities and i not in other)
 
list edges = [(i,j) for (i,j) in x if model.getVal(x[i,j]) > EPS]
 
int EPS = 1.e-6
 
list facilities = [j for j in y if model.getVal(y[j]) > EPS]
 
 False
 
 G = NX.Graph()
 
 I
 
 J
 
int k = 20
 
int m = n
 
def model = kmedian(I,J,c,k)
 
int n = 200
 
 node_color
 
 node_size
 
 nodelist
 
 other = set(j for j in J if j not in facilities)
 
dictionary position = {}
 
 same
 
 with_labels
 
 x
 
 x_pos
 
 y
 
 y_pos
 

Detailed Description

model for solving the k-median problem.

Definition in file kmedian.py.