フィルターのクリア

Reformulate quadratic program to linear program

3 ビュー (過去 30 日間)
Kernel7364
Kernel7364 2019 年 4 月 25 日
コメント済み: Kernel7364 2019 年 4 月 28 日
I have a quadratic program:
minimize
want to have a linear program by substitution:
and after substitution I have the following constraints:
,
My are binary integer values (just 0 or 1) and also my should be binary as well.
I have no idea how to implement the new constraints.
Best regards !

採用された回答

Matt J
Matt J 2019 年 4 月 25 日
編集済み: Matt J 2019 年 4 月 25 日
Organize x into an N-vector X=x(:) and organize q into an NxN matrix Q=reshape(q,[N,N]).
X=optimvar('X',[N,1],'Type','integer','LowerBound',0,'UpperBound',1);
Q=optimvar('Q',[N,N],'Type','integer','LowerBound',0,'UpperBound',1);
Now you can use the problem-based approach, expressing the constraints as follows:
e=ones(N,1);
Constraint1= Q<=e*X.';
Constraint2= Q<=X*e.';
Constraint3= Q>=e*X.'+X*e.' - 1;
  18 件のコメント
Matt J
Matt J 2019 年 4 月 28 日
編集済み: Matt J 2019 年 4 月 28 日
What do you mean, "don't know"? I gave you 3 pieces of advice...
Kernel7364
Kernel7364 2019 年 4 月 28 日
Sorry for the missunderstanding.
Your advice for the wrong solution makes sense and this helped me. After around 15 minutes the solver finished and the exitflag was -6 at first so I knew that there was a problem with it.
I am trying to find a way how to tell matlab that he please has to use CPLEX for my problem and not the solver in matlab itself. I just want a command for this but I am still looking. I know how to do it if I have a linear problem, then I have to call
cplexlp(f,A,b,Aeq,beq,lb,ub)
And Matlab uses cplex. But when i use the solve() function, I dont know how to tell matlab to solve it with Cplex.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by