DualSolve: Difference between revisions

From TomWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Solvers]]
[[Category:Solvers]]
{{cleanup|Clean this article.}}


==Purpose==
==Purpose==
Line 16: Line 15:




where <math>$x,x_{L},x_{U}\in \MATHSET{R} ^{n}$</math> , <math>$c \in \MATHSET{R}^{n}$</math> , <math>
where <math>x,x_{L},x_{U}\in \MATHSET{R} ^{n}</math> , <math>c \in \MATHSET{R}^{n}</math> , <math>A\in \MATHSET{R}^{m\times n}</math> and <math>b_{U} \in \MATHSET{R}^{m}</math>.
$A\in \MATHSET{R}^{m\times n}$</math> and <math>$b_{U} \in \MATHSET{R}^{m}$</math>.




Line 40: Line 38:




with <math>$x,c \in \MATHSET{R}^{n}$</math> , <math>
with <math>x,c \in \MATHSET{R}^{n}</math> , <math>
$A\in \MATHSET{R}^{\hat{m}\times n}$</math> and <math>$b,y \in
A\in \MATHSET{R}^{\hat{m}\times n}</math> and <math>b,y \in
\MATHSET{R}^{m}$</math>.
\MATHSET{R}^{m}</math>.




==Calling  Syntax==
==Calling  Syntax==


<syntaxhighlight lang="matlab">
[Result] = DualSolve(Prob)
[Result] = DualSolve(Prob)
</syntaxhighlight>


===Description  of Inputs===
==Description  of Inputs==
{|
 
|''Prob''||colspan="2"|Problem description structure.  The following fields are used:
{| class="wikitable"
!''Prob''
!colspan="2"|Problem description structure.  The following fields are used:
|-
|-
|||''QP.c''||Constant vector.
|||''QP.c''||Constant vector.
Line 68: Line 70:
|-
|-
|||''y_0''||Dual parameters (Lagrangian multipliers) at ''x ''_0.
|||''y_0''||Dual parameters (Lagrangian multipliers) at ''x ''_0.
|-
|-valign="top"
|||''QP.B''||Active set ''B_0 ''at start:
|||''QP.B''||Active set ''B_0 ''at start:
|-
 
|||||''B''(''i'') = 1: Include variable ''x''(''i'') is in basic set.
''B''(''i'') = 1: Include variable ''x''(''i'') is in basic set.
|-
 
|||||''B''(''i'') = 0: Variable ''x''(''i'') is set on its lower bound.
''B''(''i'') = 0: Variable ''x''(''i'') is set on its lower bound.
|-
 
|||||''B''(''i'') = ''-''1: Variable ''x''(''i'') is set on its upper bound.
''B''(''i'') = ''-''1: Variable ''x''(''i'') is set on its upper bound.
|-
|-valign="top"
|||''Solver.Alg''||Variable selection rule to be used:
|||''Solver.Alg''||Variable selection rule to be used:
|-
 
|||||0: Minimum reduced cost (default).
0: Minimum reduced cost (default).
|-
 
|||||1: Bland's anti-cycling rule.
1: Bland's anti-cycling rule.
|-
 
|||||2: Minimum reduced cost. Dantzig's rule.
2: Minimum reduced cost. Dantzig's rule.
|-
|-
|||''PriLevOpt''||Print Level.
|||''PriLevOpt''||Print Level.
|-
|-valign="top"
|||''optParam''||Structure with special fields for optimization parameters,  see Table 141.
|||''optParam''||Structure with special fields for optimization parameters,  see [[TOMLAB Appendix A]].
|-
 
|||||Fields used are: ''MaxIter'', ''wait'', ''eps f'', ''eps Rank ''and ''xTol''.
Fields used are: ''MaxIter'', ''wait'', ''eps_f'', ''eps_Rank ''and ''xTol''.
|}
|}


===Description  of Outputs===
==Description  of Outputs==


{|
{| class="wikitable"
|''Result''||colspan="2"|Structure with result from optimization.  The following fields are changed:
!''Result''
!colspan="2"|Structure with result from optimization.  The following fields are changed:
|-
|-
|||''x_k''||Optimal primal solution ''x''.
|||''x_k''||Optimal primal solution ''x''.
Line 108: Line 111:
|-
|-
|||''QP.B''||Optimal active set.
|||''QP.B''||Optimal active set.
|-
|-valign="top"
|||''ExitFlag''||Exit flag:
|||''ExitFlag''||Exit flag:
|-
 
|||||0: Optimal solution found.
0: Optimal solution found.
|-
 
|||||1: Maximal number of iterations reached. No primal feasible solution found.
1: Maximal number of iterations reached. No primal feasible solution found.
|-
 
|||||2: Infeasible Dual problem.
2: Infeasible Dual problem.
|-
 
|||||4: Illegal step length due to numerical difficulties. Should not occur.
4: Illegal step length due to numerical difficulties. Should not occur.
|-
 
|||||6: No dual feasible starting point found.
6: No dual feasible starting point found.
|-
 
|||||7: Illegal step length due to numerical difficulties.
7: Illegal step length due to numerical difficulties.
|-
 
|||||8: Convergence  because ''fk >''= ''QP.DualLimit''.
8: Convergence  because ''f<sub>k</sub> >''= ''QP.DualLimit''.
|-
 
|||||9: <math>$x_L(i) > x_U(i) + xTol$</math> for some i. No solution exists.
9: ''x<sub>L</sub>(i) > x<sub>U</sub>(i) + xTol'' for some i. No solution exists.
|-
|-
|''Solver''||Solver used.
|''Solver''||Solver used.
Line 140: Line 143:
==Description==
==Description==


When a dual feasible solution is available, the dual simplex method is possible to use. ''DualSolve ''implements this method using the algorithm in \[35, pages 105-106\].  There are three rules available for variable selection. Bland's cycling prevention rule is the choice if fear of cycling exist. The other two are variants of minimum reduced cost variable selection, the original Dantzig's rule and one which sorts the variables in increasing order in each step (the default choice).
When a dual feasible solution is available, the dual simplex method is possible to use. There are three rules available for variable selection. Bland's cycling prevention rule is the choice if fear of cycling exist. The other two are variants of minimum reduced cost variable selection, the original Dantzig's rule and one which sorts the variables in increasing order in each step (the default choice).


==M-files  Used==
==M-files  Used==

Revision as of 15:03, 17 July 2011


Purpose

Solve linear programming problems when a dual feasible solution is available.

DualSolve solves problems of the form



where Failed to parse (unknown function "\MATHSET"): {\displaystyle x,x_{L},x_{U}\in \MATHSET{R} ^{n}} , Failed to parse (unknown function "\MATHSET"): {\displaystyle c \in \MATHSET{R}^{n}} , Failed to parse (unknown function "\MATHSET"): {\displaystyle A\in \MATHSET{R}^{m\times n}} and Failed to parse (unknown function "\MATHSET"): {\displaystyle b_{U} \in \MATHSET{R}^{m}} .


Finite upper bounds on x are added as extra inequality constraints. Finite nonzero lower bounds on x are added as extra inequality constraints. Fixed variables are treated explicitly. Adding slack variables and making necessary sign changes gives the problem in the standard form



and the following dual problem is solved,



with Failed to parse (unknown function "\MATHSET"): {\displaystyle x,c \in \MATHSET{R}^{n}} , Failed to parse (unknown function "\MATHSET"): {\displaystyle A\in \MATHSET{R}^{\hat{m}\times n}} and Failed to parse (unknown function "\MATHSET"): {\displaystyle b,y \in \MATHSET{R}^{m}} .


Calling Syntax

[Result] = DualSolve(Prob)

Description of Inputs

Prob Problem description structure. The following fields are used:
QP.c Constant vector.
A Constraint matrix for linear constraints.
b_L Lower bounds on the linear constraints.
b_U Upper bounds on the linear constraints.
x_L Lower bounds on the variables.
x_U Upper bounds on the variables.
x_0 Starting point, must be dual feasible.
y_0 Dual parameters (Lagrangian multipliers) at x _0.
QP.B Active set B_0 at start:

B(i) = 1: Include variable x(i) is in basic set.

B(i) = 0: Variable x(i) is set on its lower bound.

B(i) = -1: Variable x(i) is set on its upper bound.

Solver.Alg Variable selection rule to be used:

0: Minimum reduced cost (default).

1: Bland's anti-cycling rule.

2: Minimum reduced cost. Dantzig's rule.

PriLevOpt Print Level.
optParam Structure with special fields for optimization parameters, see TOMLAB Appendix A.

Fields used are: MaxIter, wait, eps_f, eps_Rank and xTol.

Description of Outputs

Result Structure with result from optimization. The following fields are changed:
x_k Optimal primal solution x.
f_k Function value at optimum.
v_k Optimal dual parameters. Lagrange multipliers for linear constraints.
x_0 Starting point.
Iter Number of iterations.
QP.B Optimal active set.
ExitFlag Exit flag:

0: Optimal solution found.

1: Maximal number of iterations reached. No primal feasible solution found.

2: Infeasible Dual problem.

4: Illegal step length due to numerical difficulties. Should not occur.

6: No dual feasible starting point found.

7: Illegal step length due to numerical difficulties.

8: Convergence because fk >= QP.DualLimit.

9: xL(i) > xU(i) + xTol for some i. No solution exists.

Solver Solver used.
SolverAlgorithm Solver algorithm used.
c Constant vector in standard form formulation.
A Constraint matrix for linear constraints in standard form.
b Right hand side in standard form.

Description

When a dual feasible solution is available, the dual simplex method is possible to use. There are three rules available for variable selection. Bland's cycling prevention rule is the choice if fear of cycling exist. The other two are variants of minimum reduced cost variable selection, the original Dantzig's rule and one which sorts the variables in increasing order in each step (the default choice).

M-files Used

cpTransf.m

See Also

lpSimplex