MATLAB Answers

Intlinprog, how to see some parametr

2 ビュー (過去 30 日間)
Michal Malec
Michal Malec 2020 年 9 月 14 日
回答済み: Ayush Gupta 2020 年 9 月 18 日
I try to solve a math problem that give me a minimal value of a function using intlinprog. This is my code:
f=-[64.01;40]; intcon = [1;2]; b=[150;300;20]; A=[3,5;8,5;0,1];
lb = [0,0];
[x,fval, exitflag, output] = intlinprog(f,intcon,A,b,[],[],lb)
I got the following results:
x =
35.0000
4.0000
fval =
-2.4003e+03
exitflag =
1
output =
struct with fields:
relativegap: 0
absolutegap: 0
numfeaspoints: 3
numnodes: 0
constrviolation: 0
message: 'Optimal solution found.↵↵Intlinprog stopped at the root node because the objective value is within a gap tolerance of the optimal value, options.AbsoluteGapTolerance = 0 (the default value). The intcon variables are integer within tolerance, options.IntegerTolerance = 1e-05 (the default value).'
The optimization was finding 3 feasible points, but I got the best point as x vector. I want to see all points and objective values. How can I do it?

  0 件のコメント

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

回答 (1 件)

Ayush Gupta
Ayush Gupta 2020 年 9 月 18 日
Optimization tools like intlinprog find ONE solution to a problem. They are not designed to search your space and return multiple feasible solutions.
You can use the savemilpsolutions output function to collect the integer-feasible points that intlinprog found during its branch-and-bound search. See intlinprog output functions and plot functions.

  0 件のコメント

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

Community Treasure Hunt

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

Start Hunting!

Translated by