problem based optimization-multiple solutions - constraints

3 次查看(过去 30 天)
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?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by