atoptima / Coluna.jl

Branch-and-Price-and-Cut in Julia
https://www.atoptima.com
Other
193 stars 43 forks source link

How to obtain LP feasible solution? And how to set time limit? #1134

Closed juyoungwang closed 2 months ago

juyoungwang commented 2 months ago

Is your feature request related to a problem? Please describe. Hi, Thanks for providing such an amazing package!

I have two questions:

  1. I was wondering if there is any chance to obtain linear programming solution, instead of integer programming solution of branch-and-price algorithm.

The model I am solving is so huge, that the algorithm was not finding any primal feasible solution, though the gap between DB and mlp was very small.

Is there any way to retrieve this mlp solution from the solver? (so I can use some heuristics to use this solution for my problem.)

  1. To set the timelimit, I was using the following coluna parameters (stop algorithm after running time_limit_sec)
coluna = optimizer_with_attributes(
                                        Coluna.Optimizer,
                                        "params" => Coluna.Params(
                                            solver = Coluna.Algorithm.TreeSearchAlgorithm(
                                                conqueralg = Coluna.Algorithm.ColCutGenConquer(
                                                    colgen = Coluna.Algorithm.ColumnGeneration(
                                                        restr_master_solve_alg = Coluna.Algorithm.SolveLpForm(
                                                        get_ip_primal_sol = true, 
                                                        get_dual_sol = true
                                                        ),
                                                    ),
                                                ),
                                                timelimit = time_limit_sec,                                   
                                                opt_rtol = 10
                                            ),
                                        ),
                                        "default_optimizer" => Gurobi.Optimizer # Some solver for the master & the subproblems
                                    )

Unfortunately, the algorithm did not stop despite the timelimit parameter I provided. Do you have any suggestion here?

Thanks a lot, and have a great day!!

rrsadykov commented 2 months ago

Dear @juyoungwang,

Sorry for a delay with the reply.

  1. For the moment, obtaining LP solution for a MIP problem is not possible, unless you define a cut separation callback. I believe, this is a standard behaviour for mathematical programming solvers. However, you can define your problem as an LP (all variables should be continuous, and not integer), and then you will get the LP solution. The LP solution is projected to the space of original (JuMP) variables. If you want to obtain the original non-projected solution (i.e., a value of every column in the solution), you should use the BlockDecomposition.getsolutions() function.
  2. Unfortunately, for the moment, the time limit is taken into account only in the branch-and-bound algorithm, and not inside the column generation algorithm. Thus if solving the LP relaxation by the column generation takes more time than the time limit, the algorithm will not stop until the column generation termination. But you can define a limit on the number of column generation iterations to "approximate" the time limit.
juyoungwang commented 2 months ago

Dear @rrsadykov

Thanks a lot for your great support!

I think I now got deeper understanding about the package, and understood how to proceed.

Again, thanks for the answer, and have a great weekend!

juyoungwang commented 2 months ago

I am closing this issue, as my questions were answered.