Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Slow column generation

    Posted 26 days ago

    Hey,
    I am trying to use docplex for a column generation problem with +12K constraints. The sub master problem is built and solved quite fast but whenever I need to add a column, I have to add a term to every constraints which is very slow since it seems that I can't just add the column directly. For example I have something like this in my code where s_vals is already computed and y is the new variable:

                    for i in range(num_B):
                        demand_exprs[(k, i)] += s_vals[i] * y

    Thanks in advance.


    ------------------------------
    Abderrahmane DRIOUCH
    ------------------------------


  • 2.  RE: Slow column generation

    Posted 18 days ago

    Hai

    When using column generation in models, there is possibility to constraint coefficients (e.g., s_vals) be sparse. It's efficient to identify only those constraints where the new variable y has a nonzero contribution. By updating only these relevant constraints with the corresponding terms, the column addition process becomes significantly faster. You can try like

    for i in range(num_B):
    if abs(s_vals[i]) > 0:
    demand_exprs[(k, i)] += s_vals[i] * y



    ------------------------------
    Athira Babu
    ------------------------------



  • 3.  RE: Slow column generation

    Posted 15 days ago

    And this will be more efficient if it is writing like 

    for i in range(num_B):
    if s_vals[i] != 0:
    demand_exprs[(k, i)] += s_vals[i] * y



    ------------------------------
    Athira Babu
    ------------------------------