2011年12月23日星期五

CPLEX for MATLAB Toolbox


1. Install CPLEX academic free version (V12)

2. Set up the path for Matlab.

Then, all the cplex functions are ready to go!! :)

BTW, CPLEX v.12 has the matlab built-in functions.
For other version, you can try CPLEXINT.


------------------------------------------------------

CPLEX for MATLAB Toolbox

The CPLEX® for MATLAB® Toolbox provides functions for solving a variety of mathematical programming problems. The toolbox functions are designed to take a model description as input and produce a solution as output.
For example:
x = cplexlp(f,Aineq,bineq,Aeq,beq,lb,ub)
finds the minimum of a linear programming problem specified by
   min      f*x     st.      Aineq*x <= bineq              Aeq*x    = beq             lb <= x <= ub  
The toolbox provides the functions cplexlp, cplexqp and cplexbilp to solve linear programming problems (LP), quadratic programming problems (QP) and binary integer programming problems (BILP).
The toolbox provides functions that support the solution of the basic problem types handled by CPLEX are:
  • cplexlp for linear programming problems (LP),
  • cplexqp for quadratic programming problems (QP) and
  • cplexbilp for binary integer programming problems (BILP).
Functions that support the solution of additional problem types handled by CPLEX are provided. These functions are:
  • cplexqcp for quadratically constrained programming problems (QCP),
  • cplexmilp for mixed integer linear programming problems (MIP),
  • cplexmiqp for mixed integer quadratic programming problems (MIQP) and
  • cplexmiqcp for mixed integer quadratically constrained mixed integer programming problems (MIQCP).
The solution of least square problems is supported through the functions:
  • cplexlsqlin for linearly constrained least squares problems,
  • cplexlsqmilp for linearly constrained mixed integer least squares problems,
  • cplexlsqbilp for linearly constrained binary integer least squares problems,
  • cplexlsqmiqcp for quadratically constrained mixed integer least squares problems,
  • cplexlsqqcp for quadratically constrained programming problems,
  • cplexlsqnonneglin for nonnegative least squares problems,
  • cplexlsqnonnegmilp for nonnegative mixed integer least squares problems,
  • cplexlsqnonnegmiqcp for nonnegative quadratically constrained mixed integer least squares problems and
  • cplexlsqnonnegqcp for nonnegative quadratically constrained programming problems.
The advantage of the toolbox design is that you can reuse your code where you had used MATLAB® Optimization Toolbox functions to solve linear programming, quadratic programming, binary integer programming, linearly constrained least squares, and nonnegative least squares problems.

Setting and querying parameters in the CPLEX for MATLAB Toolbox

Options, also called parameters, can be set to control the solution of problems. The toolbox provides two types of options input. One type corresponds to the MATLAB Optimization Toolbox options, and the other type is the CPLEX parameters. You can use either or both of these types of options. If you use both, the CPLEX parameters will override the MATLAB options.
The toolbox options are listed in the following table.
Options corresponding to the MATLAB Optimization Toolbox
Diagnostics'on' | {'off'}
Display'off' | 'iter' | 'final' | 'notify'
MaxIterrefer to cplex.Param.simplex.limits.iterations
Simplexrefer to cplex.Param.lpmethod
refer to cplex.Param.qpmethod
refer to cplex.Param.mip.strategy.startalgorithm
BranchStrategyrefer to cplex.Param.mip.strategy.variableselect
MaxNodesrefer to cplex.Param.mip.limits.nodes
MaxTimerefer to cplex.Param.timelimit
NodeDisplayInterval
refer to cplex.Param.mip.interval
NodeSearchStrategy
refer to cplex.Param.mip.strategy.nodeselect
TolFun
refer to cplex.Param.simplex.tolerances.optimality
TolXIntegerrefer to cplex.Param.mip.tolerances.integrality
TolRLPFunrefer to cplex.Param.simplex.tolerances.optimality
.
These options can be set using the toolbox function cplexoptimset. For example, the following code turns on the optimizer output and sets a node limit of 400,
options = cplexoptimset('Diagnostics', 'on', 'MaxNodes', 400);
Alternatively, these options can be set directly on the fields of the structure. For example, the following code has the same result as the previous one.
options = cplexoptimset; options.Diagnostics = 'on'; options.MaxNodes = 400;
The current and default values of the options can be queried with the function cplexoptimget.
If you need to use CPLEX parameters that do not correspond to the options in the MATLAB Optimization Toolbox, you can create a structure which contains all of the CPLEX parameters. For example, to set a node limit of 400 and instruct CPLEX to use traditional branch and cut style search:
opt = cplexoptimset('cplex');  opt.mip.limits.nodes=400;  opt.mip.strategy.search=1;
Tip
If you are already familiar with the names of parameters in the Interactive Optimizer, then you quickly recognize names of parameters in CPLEX for MATLAB. For example, the command “set mip limits nodes 1” in the Interactive Optimizer corresponds to “opt.mip.limits.nodes = 1;” in the CPLEX for MATLAB Toolbox where opt was created with the line “opt = optimset('cplex');
To assist in setting parameters, auto-completion of parameter names is available in the MATLAB environment.

Summary of Solvers

http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Solvers.Solvers

LP solver in MATLAB

http://lpsolve.sourceforge.net/5.5/distribution.htm

Most of the links from lpsolve to other software need the lpsolve library lpsolve55.dll (Windows) or lpsolve55.so (Unix/Linux/Mac). This library is in general not included in the archives. It must be installed separately. It is contained in archive lp_solve_5.5.2.0_dev_win*.zip (Windows) / lp_solve_5.5.2.0_dev_ux*.tar.gz (Linux) / lp_solve_5.5.2.0_dev_osx*.tar.gz

optimization packages

If you are trying to convert your code to Python, here is the link for the optimization packages available in python,

http://www.scipy.org/SciPyPackages/Optimize

In particular, the OpenOpt package can solve some mix-integer problems. Details can be found from the following link:

http://scipy.org/scipy/scikits/wiki/OpenOpt

2011年12月14日星期三

Reviewer for ICACT 2012.

volunteered for ICACT 2012 and reviewed 5 PAPERS.

2011年12月13日星期二

interference alignment

Very clear illustration
http://people.csail.mit.edu/gshyam/Papers/IAC.pdf

best reference cite
http://www.profheath.org/research/interference-alignment/

attached David Tse's talk in Mobicom

2011年12月10日星期六

chance constrained programming ,sample approximation

chance constrained programming


sample approximation