i am trying to solve a MIP in which modules are arranged. First i had the problem set up that every module can sit in every possible place, so i have O(n) = n!
What i now tried was to change the problem to not every module can sit everywhere, for example if i have 8 modules with 4 classes in which the specific 2 modules can change place, but not every module can sit everywhere. I guessed that this should enormously reduce the complexity of the algorithm. I attached how i coded this:
This variables are set in a double for-loop. Before the Var was set by addVar(0.0 , 1.0 , 0.0 GRB.BINARY), so that every module can be in every possible place.
My Array auswahl auswahl is looking the following way:
So it allows every module to sit in just 2 places, and it actually worked. But it made the algorithm much slower instead of faster.
Can anybody tell me why this is happening or how i could implement the thing i want to do so that it reduces my complexity?
Please sign in to leave a comment.