Discussion Design optimization using discrete decision variables in Excel
https://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2343386#M99458
<P>Hi!</P><P> </P><P>I have a linear equation system that is based on a couple of input variables (x,y,z,w). </P><P>The variables can only have certain values, e.g. x=[1 2 3 ... 50], y=[0.1 0.2 ... 20], z=[5 10 15 ... 50], w=[1.3 5.6 7.8 13.1 14.4]. The problem also consist of a couple of constraints and an objective. </P><P>My solution so far can be described in the following way:</P><P>* Calculate the equation system for each combination of variables, one solution per column</P><P>* Remove the solutions where the constraints are not met</P><P>* Rank the remaining solutions</P><P>* Retrieve the input variables that correspond to the optimized solution (index match)</P><P> </P><P>I think this is a simple way, but depending on the number of combinations (which is around 15-20000 for my actual problem), this can be a bit time-consuming and all of this data slows down the program. </P><P> </P><P>But then I found out about the Solver-function, which seemed to be perfect for me. Define decision variables, constraints and an objective. The only problem is that the decision variables can only be defined in different intervals as continuous values. Not a couple of discrete values based on a list, which is my case.</P><P> </P><P>The scenario manager on the other hand, where I can define the combinations, seems pretty straight forward, but then I need to define 15-20000 scenarios..</P><P> </P><P>Do anyone have a proposal of how to solve this problem in an efficient way? <LI-EMOJI id="lia_grinning-face-with-big-eyes" title=":grinning_face_with_big_eyes:"></LI-EMOJI> </P>Tue, 11 May 2021 06:49:56 GMTabbe19922021-05-11T06:49:56ZDesign optimization using discrete decision variables
https://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2343386#M99458
<P>Hi!</P><P> </P><P>I have a linear equation system that is based on a couple of input variables (x,y,z,w). </P><P>The variables can only have certain values, e.g. x=[1 2 3 ... 50], y=[0.1 0.2 ... 20], z=[5 10 15 ... 50], w=[1.3 5.6 7.8 13.1 14.4]. The problem also consist of a couple of constraints and an objective. </P><P>My solution so far can be described in the following way:</P><P>* Calculate the equation system for each combination of variables, one solution per column</P><P>* Remove the solutions where the constraints are not met</P><P>* Rank the remaining solutions</P><P>* Retrieve the input variables that correspond to the optimized solution (index match)</P><P> </P><P>I think this is a simple way, but depending on the number of combinations (which is around 15-20000 for my actual problem), this can be a bit time-consuming and all of this data slows down the program. </P><P> </P><P>But then I found out about the Solver-function, which seemed to be perfect for me. Define decision variables, constraints and an objective. The only problem is that the decision variables can only be defined in different intervals as continuous values. Not a couple of discrete values based on a list, which is my case.</P><P> </P><P>The scenario manager on the other hand, where I can define the combinations, seems pretty straight forward, but then I need to define 15-20000 scenarios..</P><P> </P><P>Do anyone have a proposal of how to solve this problem in an efficient way? <LI-EMOJI id="lia_grinning-face-with-big-eyes" title=":grinning_face_with_big_eyes:"></LI-EMOJI> </P>Tue, 11 May 2021 06:49:56 GMThttps://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2343386#M99458abbe19922021-05-11T06:49:56ZRe: Design optimization using discrete decision variables
https://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2344873#M99502
<P><LI-USER uid="1050488"></LI-USER> </P>
<P>Solver can constrain input variable to be whole numbers. You could use formulas to convert for example input 1, 2, ..., 50 to 0.1, 0.2, 50.0</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="S0396.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/279818i2FE6C2C194978B27/image-size/medium?v=v2&px=400" role="button" title="S0396.png" alt="S0396.png" /></span></P>
<P>Solver will use B2 to B5 as variables, but your target formula should refer to C2 to C5.</P>
<P>In the screenshot, F2:G5 is a lookup table for C5; the formula in C5 is =VLOOKUP(B5,F1:G5,2,FALSE)</P>Tue, 11 May 2021 14:53:33 GMThttps://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2344873#M99502Hans Vogelaar2021-05-11T14:53:33ZRe: Design optimization using discrete decision variables
https://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2347654#M99562
I really like the idea about using a lookup table for this problem. I will try this out!<BR />Thank you very much!Wed, 12 May 2021 06:39:41 GMThttps://techcommunity.microsoft.com/t5/excel/design-optimization-using-discrete-decision-variables/m-p/2347654#M99562abbe19922021-05-12T06:39:41Z