Quickguide MIQP Problem: Difference between revisions

From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} The general formulation in TOMLAB for a mixed-integer quadratic programming problem is: <math> \be...")
 
No edit summary
 
Line 9: Line 9:
s/t & \begin{array}{lcccl}
s/t & \begin{array}{lcccl}
x_{L} & \leq  & x    & \leq & x_{U}, \\
x_{L} & \leq  & x    & \leq & x_{U}, \\
b_{L} & \leq  & A x  & \leq & b_{U},    ~x_{j} \in \MATHSET{N}\ ~~\forall j \in $I$  \\
b_{L} & \leq  & A x  & \leq & b_{U},    ~x_{j} \in \mathbb{N}\ ~~\forall j \in $I$  \\
\end{array}
\end{array}
\end{array}
\end{array}
Line 15: Line 15:




where <math>c, x, x_L, x_U \in \MATHSET{R}^n</math>, <math>A \in \MATHSET{R}^{m_1
where <math>c, x, x_L, x_U \in \mathbb{R}^n</math>, <math>A \in \mathbb{R}^{m_1
\times n}</math>, and <math>b_L,b_U \in \MATHSET{R}^{m_1}</math>. The variables <math>x
\times n}</math>, and <math>b_L,b_U \in \mathbb{R}^{m_1}</math>. The variables <math>x
\in I</math>, the index subset of <math>1,...,n</math> are restricted to be
\in I</math>, the index subset of <math>1,...,n</math> are restricted to be
integers. Equality constraints are defined by setting the lower
integers. Equality constraints are defined by setting the lower
Line 28: Line 28:
Open the file for viewing, and execute miqpQG in Matlab.
Open the file for viewing, and execute miqpQG in Matlab.


<syntaxhighlight lang="matlab">
<source lang="matlab">
  % miqpQG is a small example problem for defining and solving
  % miqpQG is a small example problem for defining and solving
  % mixed-integer quadratic programming problems using the TOMLAB format.
  % mixed-integer quadratic programming problems using the TOMLAB format.
Line 56: Line 56:
  %Result = tomRun('xpress-mp', Prob, 1);
  %Result = tomRun('xpress-mp', Prob, 1);
  %Result = tomRun('minlpBB', Prob, 1);
  %Result = tomRun('minlpBB', Prob, 1);
</syntaxhighlight>
</source>

Latest revision as of 07:47, 17 January 2012

Notice.png

This page is part of the Quickguide Manual. See Quickguide.

The general formulation in TOMLAB for a mixed-integer quadratic programming problem is:



where , , and . The variables , the index subset of are restricted to be integers. Equality constraints are defined by setting the lower bound equal to the upper bound, i.e. for constraint : .

The following file illustrates how to solve a MIQP problem in TOMLAB.

File: tomlab/quickguide/miqpQG.m

Open the file for viewing, and execute miqpQG in Matlab.

 % miqpQG is a small example problem for defining and solving
 % mixed-integer quadratic programming problems using the TOMLAB format.
 
 c    = [-6 0]';
 Name = 'XP Ref Manual MIQP';
 F    = [4 -2;-2 4];
 A    = [1 1];
 b_L  = -Inf;
 b_U  = 1.9;
 x_L  = [0 0]';
 x_U  = [Inf Inf]';
 
 % Defining first variable as an integer
 IntVars   = 1;
 
 % Assign routine for defining a MIQP problem.
 Prob = miqpAssign(F, c, A, b_L, b_U, x_L, x_U, [], ...
            IntVars, [], [], [], Name, [], []);
 
 % Calling driver routine tomRun to run the solver.
 % The 1 sets the print level after optimization.
 
 Result = tomRun('cplex', Prob, 1);
 %Result = tomRun('oqnlp', Prob, 1);
 %Result = tomRun('miqpBB', Prob, 1);
 %Result = tomRun('xpress-mp', Prob, 1);
 %Result = tomRun('minlpBB', Prob, 1);