3
$\begingroup$

I want to use pyomo to formulate MILP problems in python such as Green Vehicle Routing Problem and others but use metaheuristics algorithms (GA, Harmony search, etc.) to solve those problems instead of using pyomo solvers, its part of my PhD project and can not use derivative-based solvers such as Gurobi and cplex etc. at all; If the answer that I can not, what is the alternative to formulate the problems in python then solve them with metaheuristics algorithms because I found pyomo easy and time saving to be used in formulating the problems.

$\endgroup$

3 Answers 3

3
$\begingroup$

I think what you want is a meta-heuristic you can use without relying on all the work necessary to code one from the ground. If this is the case, I would recommend you to use the Biased Random Key Genetic Algorithm (BRKGA). Suffices to have in mind the basic notations of Genetic Algorithms, specifically the notion of chromosome and decode function, and there we go. In the section 8.5 of this paper, you can find a decode function applied for a G-VRP variant.

$\endgroup$
2
$\begingroup$

If you are interested to write the problem as a standard formulation, like mixed-integer linear programming, you can use Pyomo as a framework and solve the problem in an exact manner with your favorite solver.

About the (meta)heuristic, it is somewhat different from the exact method. In this case either you should already write your own algorithm or use some package/libraries to do it. Also, the flowing package and thread might be helpful.

$\endgroup$
5
  • $\begingroup$ Thank you for answering, in that case exact methods will not help me, but for now I'm looking for a mean to formulate the problem alone then focus on solving it with metaheuristics algorithms $\endgroup$ Commented Aug 3, 2022 at 11:20
  • 1
    $\begingroup$ most of the time, when you use metaheuristics, you want to verify or evaluate the solution using exact solver like gurobi or cplex. Hi Ahmed, i did my thesis research in vrp time windows too $\endgroup$
    – overboxed
    Commented Aug 3, 2022 at 14:09
  • 1
    $\begingroup$ i wanna discuss more about vrp, maybe if you are open, we can have a nice discussion about it $\endgroup$
    – overboxed
    Commented Aug 3, 2022 at 14:11
  • 1
    $\begingroup$ @AhmedAbdulmunem, you're welcome. Almost all of the VRP variants are changing problems and solving them in the large-scale data with an exact method would be a complicating task. One of the interesting python packages to do is vrpy. Also, by a little search on GitHub, you could find some useful repositories to check and benchmark. $\endgroup$
    – A.Omidi
    Commented Aug 3, 2022 at 17:26
  • $\begingroup$ @overboxed , I would love to $\endgroup$ Commented Aug 3, 2022 at 18:43
1
$\begingroup$

Another option is to solve your problem with a hybrid approach, a math-heuristic. For example, you could use a metaheuristic to define some of the variables (maybe, the integer ones) and then solve the parametrized problem using MILP solver. For example, several ideas can be found here, here, here, here, and here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.