symphony

Solves a mixed-integer linear optimization problem.

Calling Sequence

xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB)
xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,objSense)
xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,objSense,options)
[xopt,fopt,status,output] = symphony( ... )

Input Parameters

nbVar :

A double, representing the number of variables.

nbCon :

A double, representing the number of constraints.

c :

A vector of doubles, representing the coefficients of the variables in the objective.

isInt :

A vector of booleans, representing whether a variable is constrained to be an integer.

lb :

A vector of doubles, containing the lower bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.

ub :

A vector of doubles, containing the upper bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.

A :

A matrix of double, representing the constraint matrix in conLB ≤ A⋅x ≤ conUB.

conLB :

A vector of double, representing the lower bounds of the constraints conLB ≤ A⋅x ≤ conUB.

conUB :

A vector of double, representing the upper bounds of the constraints conLB ≤ A⋅x ≤ conUB.

objSense :

The sense (maximization/minimization) of the objective. Use 1(sym_minimize ) or -1 (sym_maximize) here.

options :

A list, containing the option for user to specify. See below for details.

Outputs

xopt :

A vector of doubles, containing the computed solution of the optimization problem.

fopt :

A double, containing the value of the function at x.

status :

The status flag returned from symphony. See below for details.

output :

A structure, containing the information about the optimization. See below for details.

Description

Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by: The routine calls SYMPHONY, a solver for mixed-integer linear programs written in C, for the actual computation.

Options

The options should be defined as type "list" and consist of over a hundred fields, the most important ones of which have been detailed here:

• node_limit : A scalar, specifying the max. number of nodes allowed to be analyzed during the solution.
• time_limit : A scalar, specifying the maximum amount of CPU time in seconds that the solver should take.
• gap_limit : A scalar, representing the target gap limit allowed for solution.
• granularity : A scalar, “the minimum difference between two distinct objective function values
• node_selection_rule : A Scalar, specifying the maximum number of iterations that the solver should take.
• prep_level : An integer, that determines the level of preprocessing that should be done on the current MILP instance.
• do_branch_and_cut : A boolean, representing the decision whether to run the branch and cut algorithm or not.

The status allows the user to know the status of the optimization which is returned by Symphony. The values it can take and what they indicate is described below:

• 227 : Optimal Solution Found
• 228 : Maximum CPU Time exceeded.
• 229 : Maximum Number of Node Limit Exceeded.
• 230 : Maximum Number of Iterations Limit Exceeded.

For more details on the status, see the symphony documentation which can be found on http://www.coin-or.org/SYMPHONY/man-5.6/

The output data structure contains detailed information about the optimization process. It is of type "struct" and contains the following fields.

• output.iterations: The number of iterations performed.

A few examples displaying the various functionalities of symphony have been provided below. You will find a series of problems and the appropriate code snippets to solve them.

Example //Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. "An application of mixed integer programming in a Swedish steel mill." Interfaces 7, no. 2 (1977): 39-43. // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,8,1); // Upper Bound of variables ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix A = [5,3,4,6,1,1,1,1; 5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; 5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] // Lower Bound of constraints conlb = [ 25; 1.25; 1.25] // Upper Bound of constraints conub = [ 25; 1.25; 1.25] // Row Matrix for telling symphony that the is integer or not isInt = [repmat(%t,1,4) repmat(%f,1,4)]; xopt = [1 1 0 1 7.25 0 0.25 3.5] fopt =  options = list("time_limit", 25); // Calling Symphony [x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1,options); // Press ENTER to continue

Example

Here we provide the sense (maximization/minimization) of the objective and show how we can further enhance the functionality of symphony by setting input options. This provides us with the ability to control the solver parameters such as the maximum number of solver iterations and the max. CPU time allowed for the computation.

 //Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. "An application of mixed integer programming in a Swedish steel mill." Interfaces 7, no. 2 (1977): 39-43. // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,8,1); // Upper Bound of variables ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix A = [5,3,4,6,1,1,1,1; 5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; 5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] // Lower Bound of constraints conlb = [ 25; 1.25; 1.25] // Upper Bound of constraints conub = [ 25; 1.25; 1.25] // Row Matrix for telling symphony that the is integer or not isInt = [repmat(%t,1,4) repmat(%f,1,4)]; xopt = [1 1 0 1 7.25 0 0.25 3.5] fopt =  options = list("time_limit", 25); // Calling Symphony [x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1,options); // Press ENTER to continue

Example 