rbfopt_degree0_models module

Pyomo models with zero-degree polynomial for RBFOpt.

This module creates all the auxiliary problems that rely on zero-degree polynomials. The models are created and instantiated using Pyomo. This module does not solve the problems.

Licensed under Revised BSD license, see LICENSE. (C) Copyright Singapore University of Technology and Design 2014. (C) Copyright International Business Machines Corporation 2017.

rbfopt_degree0_models.add_categorical_constraints(model, categorical, not_categorical, categorical_expansion)[source]

Add categorical constraints to the model.

Add constraints enforcing the assignment constraints for categorical variables.

Parameters
modelpyomo.ConcreteModel

The model to which we want to add integrality constraints.

categorical1D numpy.ndarray[int]

Array of indices of categorical variables in original space.

not_categorical1D numpy.ndarray[int]

Array of indices of not categorical variables in original space.

categorical_expansionList[(int, float, 1D numpy.ndarray[int])]

Expansion of original categorical variables into binaries.

rbfopt_degree0_models.add_integrality_constraints(model, integer_vars)[source]

Add integrality constraints to the model.

Add integrality constraints to the model by introducing extra variables.

Parameters
modelpyomo.ConcreteModel

The model to which we want to add integrality constraints.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

rbfopt_degree0_models.create_max_h_k_model(settings, n, k, var_lower, var_upper, integer_vars, categorical_info, node_pos, rbf_lambda, rbf_h, mat, target_val)[source]

Create the abstract model to maximize h_k.

Create the abstract model to maximize h_k, also known as the Global Search Step of the RBF method.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

categorical_info(1D numpy.ndarray[int], 1D numpy.ndarray[int],

List[(int, 1D numpy.ndarray[int])]) or None

Information on categorical variables: array of indices of categorical variables in original space, array of indices of noncategorical variables in original space, and expansion of each categorical variable, given as a tuple (original index, indices of expanded variables).

node_pos2D numpy.ndarray[float]

List of coordinates of the nodes (one on each row).

rbf_lambda1D numpy.ndarray[float]

The lambda coefficients of the RBF interpolant, corresponding to the radial basis functions. List of dimension k.

rbf_h1D numpy.ndarray[float]

The h coefficients of the RBF interpolant, corresponding to the polynomial. List of dimension n+1.

mat: 2D numpy.ndarray[float]

The matrix necessary for the computation. This is the inverse of the matrix [Phi P; P^T 0], see paper as cited above. Must be a 2D numpy.ndarray[float] of dimension ((k+1) x (k+1))

target_valfloat

Value f* that we want to find in the unknown objective function.

Returns
pyomo.ConcreteModel

The concrete model describing the problem.

rbfopt_degree0_models.create_max_one_over_mu_model(settings, n, k, var_lower, var_upper, integer_vars, categorical_info, node_pos, mat)[source]

Create the concrete model to maximize 1/mu.

Create the concrete model to maximize :math: 1/mu, also known as the InfStep of the RBF method.

See paper by Costa and Nannicini, equation (7) pag 4, and the references therein.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

categorical_info(1D numpy.ndarray[int], 1D numpy.ndarray[int],

List[(int, 1D numpy.ndarray[int])]) or None

Information on categorical variables: array of indices of categorical variables in original space, array of indices of noncategorical variables in original space, and expansion of each categorical variable, given as a tuple (original index, indices of expanded variables).

node_pos2D numpy.ndarray[float]

List of coordinates of the nodes (one on each row).

mat: 2D numpy.ndarray[float]

The matrix necessary for the computation. This is the inverse of the matrix [Phi P; P^T 0], see paper as cited above. Must be a 2D numpy.ndarray[float] of dimension ((k+1) x (k+1))

Returns
pyomo.ConcreteModel

The concrete model describing the problem.

rbfopt_degree0_models.create_maximin_dist_model(settings, n, k, var_lower, var_upper, integer_vars, categorical_info, node_pos)[source]

Create the concrete model to maximize the minimum distance.

Create the concrete model to maximize the minimum distance to the interpolation nodes, which is the infstep of the MSRSM method.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

categorical_info(1D numpy.ndarray[int], 1D numpy.ndarray[int],

List[(int, 1D numpy.ndarray[int])]) or None

Information on categorical variables: array of indices of categorical variables in original space, array of indices of noncategorical variables in original space, and expansion of each categorical variable, given as a tuple (original index, indices of expanded variables).

node_pos2D numpy.ndarray[float]

List of coordinates of the nodes.

Returns
pyomo.ConcreteModel

The concrete model describing the problem.

rbfopt_degree0_models.create_min_bump_model(settings, n, k, Phimat, Pmat, node_val, node_err_bounds)[source]

Create a model to find RBF coefficients with min bumpiness.

Create a quadratic problem to compute the coefficients of the RBF interpolant that minimizes bumpiness and lets all points deviate by a specified amount from their value.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

Phimat2D numpy.ndarray[float]

Matrix Phi, i.e. top left part of the standard RBF matrix.

Pmat2D numpy.ndarray[float]

Matrix P, i.e. top right part of the standard RBF matrix.

node_val1D numpy.ndarray[float]

List of values of the function at the nodes.

node_err_bounds2D numpy.ndarray[float]

Allowed deviation from node values for nodes affected by error. This is a matrix with rows (lower_deviation, upper_deviation).

Returns
pyomo.ConcreteModel

The concrete model describing the problem.

rbfopt_degree0_models.create_min_msrsm_model(settings, n, k, var_lower, var_upper, integer_vars, categorical_info, node_pos, rbf_lambda, rbf_h, dist_weight, dist_min, dist_max, fmin, fmax)[source]

Create the concrete model to optimize the MSRSM objective.

Create the concreate model to minimize a weighted combination of the value of the RBF interpolant and the (negative of the) distance from the closes interpolation node. This is the Global Search Step of the MSRSM method.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

node_pos2D numpy.ndarray[float]

List of coordinates of the nodes (one on each row).

categorical_info(1D numpy.ndarray[int], 1D numpy.ndarray[int],

List[(int, 1D numpy.ndarray[int])]) or None

Information on categorical variables: array of indices of categorical variables in original space, array of indices of noncategorical variables in original space, and expansion of each categorical variable, given as a tuple (original index, indices of expanded variables).

rbf_lambda1D numpy.ndarray[float]

The lambda coefficients of the RBF interpolant, corresponding to the radial basis functions. List of dimension k.

rbf_h1D numpy.ndarray[float]

The h coefficients of the RBF interpolant, corresponding to the polynomial. List of dimension n+1.

dist_weightfloat

The weight paramater for distance and RBF interpolant value. Must be between 0 and 1. A weight of 1.0 corresponds to using solely distance, 0.0 to objective function.

dist_minfloat

The minimum distance between two interpolation nodes.

dist_maxfloat

The maximum distance between two interpolation nodes.

fminfloat

The minimum value of an interpolation node.

fmaxfloat

The maximum value of an interpolation node.

Returns
pyomo.ConcreteModel

The concrete model describing the problem.

rbfopt_degree0_models.create_min_rbf_model(settings, n, k, var_lower, var_upper, integer_vars, categorical_info, node_pos, rbf_lambda, rbf_h)[source]

Create the concrete model to minimize the RBF.

Create the concrete model to minimize the RBF.

Parameters
settingsrbfopt_settings.RbfoptSettings

Global and algorithmic settings.

nint

The dimension of the problem, i.e. size of the space.

kint

Number of nodes, i.e. interpolation points.

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D numpy.ndarray[int]

List of indices of integer variables.

categorical_info(1D numpy.ndarray[int], 1D numpy.ndarray[int],

List[(int, 1D numpy.ndarray[int])]) or None

Information on categorical variables: array of indices of categorical variables in original space, array of indices of noncategorical variables in original space, and expansion of each categorical variable, given as a tuple (original index, indices of expanded variables).

node_pos2D numpy.ndarray[float]

List of coordinates of the nodes.

rbf_lambda1D numpy.ndarray[float]

The lambda coefficients of the RBF interpolant, corresponding to the radial basis functions. List of dimension k.

rbf_h1D numpy.ndarray[float]

The h coefficients of the RBF interpolant, corresponding to the polynomial. List of dimension n+1.

Returns
pyomo.ConcreteModel

The concrete model describing the problem.