Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Setting value to a decision variable

    Posted 08/20/08 11:40 PM

    Originally posted by: SystemAdmin


    [pmarley2 said:]

    Hi,

    I have another question about CPLEX.

    I have a decision variable (dvar), called Take[][], that is a two-dim array, each of whose elements can be 0 or 1. That is, part of my reported solutions will report the values of each element in Take.

    The structure of the problem is the following: I have 4 energy providers who will provide energy over 4 hours, and I am deciding which providers to engage in such a combination that I minimize the total expense (since each provider submits a bid as to what the price of its energy is). So Take[][] is a 4x4 array, with four rows for the four suppliers, and four columns for the number of hours.

    I want to set the first column of the dvar Take[][] to all zeros, so that none of the providers are selected in the first hour. Is it possible to do this for a decision variable before the objective function is shown in my code, and if so, what is the syntax I have to use?

    Thanks,
    Piku
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Setting value to a decision variable

    Posted 08/20/08 11:49 PM

    Originally posted by: SystemAdmin


    [aroso said:]

    Hi Piku,

    If I understand correctly, you want to fix part of a decision variable to 0 before starting the optimization process. Is this the case?
    Are you planning to use the same model without that restriction?

    Antonio
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Setting value to a decision variable

    Posted 08/21/08 12:00 AM

    Originally posted by: SystemAdmin


    [pmarley2 said:]

    Hi Antonio,

    Yes, I want to fix part of the dvar. Actually, I need this restriction in my problem, but I handled it before by just initializing a static variable array to all zeros, and then treating that as the first hour, or the first column of Take. However, the problem I had was that, in the objective function, I had to have one term dealing with just the first hour, and then another dealing with the rest of the hours. I want to combine these into one term, because if I can do this, I should be able to get the solution much faster.

    Do you know how to fix part of a dvar?

    Thanks,
    Piku
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Setting value to a decision variable

    Posted 08/21/08 12:28 AM

    Originally posted by: SystemAdmin


    [aroso said:]

    pmarley2,

    Is this a linear or non linear problem?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Setting value to a decision variable

    Posted 08/21/08 01:05 AM

    Originally posted by: SystemAdmin


    [pmarley2 said:]

    Hi,

    It's nonlinear. I've already run the program and it works when I just set the first hour to a static variable array, but I'd like to be able to set the decision variable directly.

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Setting value to a decision variable

    Posted 08/21/08 05:32 AM

    Originally posted by: SystemAdmin


    [prubin said:]

    [quote author=pmarley2 link=topic=511.msg1513#msg1513 date=1219257616]
    I want to set the first column of the dvar Take[][] to all zeros, so that none of the providers are selected in the first hour. Is it possible to do this for a decision variable before the objective function is shown in my code, and if so, what is the syntax I have to use?


    Any reason you cannot simply add a constraint that Take[i][0] = 0 for all i (or change the upper bound on Take[i][0] to 0)?

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Setting value to a decision variable

    Posted 08/25/08 07:05 PM

    Originally posted by: SystemAdmin


    [pmarley2 said:]

    Thanks Paul,

    Didn't think of that. I think it'll work, so I'll try it out.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Setting value to a decision variable

    Posted 08/25/08 08:31 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    Remind me to preview my reply next time.  :-)  Whatever I typed apparently needed to be escaped.
    #CPLEXOptimizers
    #DecisionOptimization