Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Culex gives the same solutions for all variables

    Posted 07/22/23 05:30 PM

    I am trying to maximize a problem that contains a set of continuous variables(x_1,...,x_n \in [0,1]) using CPLEX. I attached the code in the following. The problem is that culex always gives me all the variables x_1,.., xn =0.5 which is the wrong answer. I changed the c matrix (cost function), and do warm startup, but nothing changes the solutions. It gives always the solution of 0.5 for all variables. Could any one kindly help me? Thanks

    from docplex.mp.model import Model
    
    mdl = Model()
    x = [mdl.continuous_var(0,1,name="x%s" % i) for i in range(len(c))]
    
    
    objective =  mdl.sum(
        [c[i, j] * x[i] * (1 - x[j]) for i in range(len(c)) for j in range(len(c))]
    )
    mdl.maximize(objective)
    warmstart=mdl.new_solution()
    warmstart.add_var_value(x[0],0.5)
    warmstart.add_var_value(x[1],0.25)
    mdl.add_mip_start(warmstart)
    
    
    sol=mdl.solve(log_output=True)



    ------------------------------
    Roya Radgohar
    ------------------------------


  • 2.  RE: Culex gives the same solutions for all variables

    Posted 07/24/23 01:38 AM

    Could you please share the cost matrices c[i,j] you used ? (anyway I would expect 0.5 for all variables to be the right maximization answer).



    ------------------------------
    Stefano Gliozzi
    ------------------------------



  • 3.  RE: Culex gives the same solutions for all variables

    Posted 07/24/23 03:57 AM

    Same question at

    https://stackoverflow.com/questions/76745831/cplex-giving-the-same-solutions-for-all-the-variables/76746835#76746835 htt

    ps://twitter.com/Jacob_OpenRules/status/1678403022416670720?s=20

    If you derive x * x - x you get 2 * x - 1 so you get the max value when x is 0.5
    
    So what you get is normal


    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------