Filter löschen
Filter löschen

problem based optimization-multiple solutions - constraints

1 Ansicht (letzte 30 Tage)
Christian Schumacher
Christian Schumacher am 9 Okt. 2019
Hello,
I attempted to solve an optimizationn problem using intlinprog with the solver based approach. After adding all constraints I wanted to solve the problem again with a littel adjustment. My problem in short: i have n players and want to choose k = 9 players from this player pool. After this I want to do the same thing again, with one new constraint: the overlap between the chosen players between run 1 und run 2 should be a maximum of 7. I wrote this to solve my problem:
i8 = 1:num_skaters;
i9 = 1:num_goalies;
overlap = sum(s_lineups(i8).*skaters_lineup(i8)) + sum(g_lineups(i9).*goalies_lineup(i9));
lineup_creator.Constraints.overlaprule = overlap <= 7;
before the loop s_lineup and g_lineup are consisting only zeros. skaters_lineup and goalies_lineup are are my binary optimization variables. I get a vector with 8 skaters (8 ones)and 1 goalie (1 one) from every step in the loop. in the end of every iteration I added this:
s_lineups = s_lineups + sol.skaters_lineup;
g_lineups = g_lineups + sol.goalies_lineup;
To test my constraint I set:
lineup_creator.Constraints.overlaprule = overlap <= 9;
this should lead to yield the same solution for every iteration, because I only have 9 players per solution, if the overlap is 9 the solution shouldnt change.
Unfortunaly, this is not the case. After a few iteration I get less optimal solution.
If i try to use it as intended with 7, I am not able to get more than 10 solutions, although it is definitly possible.
Does anyone have a idea for this?

Antworten (0)

Kategorien

Mehr zu Problem-Based Optimization Setup 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!

Translated by