intlinprog no feasible solution
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am attepting to maximize the value of a portfolio by selecting 9 investments belonging to 6 categories from a list without replacement. The constraints are as follows:
investment 1: category A
investment 2: category B
investment 3: category C
investment 4&5: category D
investment 6&7: category E
investment 8: category F
investment 9: category B, C, D, E or F
Using intlinprog I get "Intlinprog stopped because no point satisfies the constraints." I have used intlinprog to solve similar problems in the past withouth encountering this error. Any suggestions are appreciated.
inputData = readtable('data.csv');
N = height(inputData);
intcon = 1:N;
A = inputData.cost';
b = 40e3;
Aeq = double([strcmp(inputData.category, 'A')'
strcmp(inputData.category, 'B')'
strcmp(inputData.category, 'C')'
strcmp(inputData.category, 'D')'
strcmp(inputData.category, 'E')'
strcmp(inputData.category, 'F')'
~strcmp(inputData.category, 'A')']);
beq = [1; 1; 1; 2; 2; 1; 1];
lowerBound = zeros(N,1);
upperBound = ones(N,1);
f = -(inputData.value);
[x, fval] = intlinprog(f, intcon, A, b, Aeq, beq, lowerBound, upperBound);
0 Kommentare
Antworten (1)
David Wilson
am 10 Apr. 2019
Are you sure you are implementing your either/or constraints properly? For example where is your "big M"?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Linear Programming and Mixed-Integer Linear Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!