Filter löschen
Filter löschen

Integer optimization returns decimal numbers

6 Ansichten (letzte 30 Tage)
Johannes Hjalmarsson
Johannes Hjalmarsson am 3 Apr. 2023
Beantwortet: Alan Weiss am 3 Apr. 2023
Hello!
I am working with a problem where I have implemented an integer linear programming optimization. The optimization variables are all integers with the following setup:
P = optimvar('P', 24,5,'Type','integer','LowerBound',0,'UpperBound',5);
alfa = optimvar('alfa' ,24,5,'Type','integer','LowerBound',0,'UpperBound',1);
I have added an objective function and a set of active constraints, and an optimal solution can be found in every iterations of my algorithm.
Although, in the results I can notice that the optimization variables sometimes are chosen as decimal numbers, e.g. 1e-5 or 1e-15.
How come this can happen?
BR
Johannes

Antworten (1)

Alan Weiss
Alan Weiss am 3 Apr. 2023
The intlinprog solver (which solve calls internally for MILP problems) does not necessarily return or use internally exact integers. If you want exact integers, round your results, which might result in some linear constraints becoming slightly infeasible. See Limitations.
Alan Weiss
MATLAB mathematical toolbox documentation

Kategorien

Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by