# Is it useful to consider metaheuristics for power flow optimization involving binary variables?

I want to optimize the power flow in a low voltage grid, with respect to customer requests for electric vehicle (EV) charging, but also avoid grid overload (basically, the formulation can be seen in an older question from me). But now, I also want to include controllable electrical loads in the households (for example heat pump) in the optimization (where electric and thermal demand of the household always needs to be covered).

As result I imagine things like: "the EV cannot charge right now, because the heat pump is running" or "there is enough energy in the thermal storage, so the heat pump does not have to run, the EV can be charged instead".

These heatpumps can only run if a certain minimum electrical input can be realized (similar to another question from me). This leads to binary variables in my problem formulation. And I have many households with a heat pump in the grid. And I consider many time steps. So I have many variables (and some of them binary).

Now I have already seen that binary variables (only considering one household) drastically increase the time for solving the optimization model. However, I need to run the optimization in regular intervals (e.g. each minute would be super). This is impossible with all these binary variables.

Now I have heard about metaheuristics (like particle swarm optimization, ant colony optimization, artificial bee colony and may more...). For example, I read this question, but there aren't binary variables mentioned. It is always about continuous optimization (which sounds to me like binary variables are not allowed).

So after a lot of background, finally my question:

Would it make sense, to consider using metaheuristics to solve my optimization problem? Or can you directly say: no, forget about it? Maybe there are other methods I haven heard of yet?

• "Now I have already seen, that binary variables (only considering one household) drastically increase the time for solving the optimization model." What did you try exactly? using a MINLP solver directly might be enough to find a good solution quickly Commented Feb 18, 2023 at 11:25
• You should always consider heuristics when MIP solvers run out of steam. But notice, you can stop a MIP solver early. It is then essentially a heuristic. Giving an algorithm 1 minute is rather stringent. Maybe you can run the model only every 15 or 30 minutes and do simpler local "update" models in between. Commented Feb 18, 2023 at 12:48