Page 1 of 1

Using Heuristic algorithm in GAMS

Posted: Fri Jun 14, 2019 7:21 pm
by linkho
Hi all, Does anyone have an example of implementation of Heuristic Algorithm (e.g. GA or SA) in GAMS?

is it possible to run a GA or SA MATLAB code in GAMS code?
How to use meta heuristic (GA) MATLAB code in GAMS?



Many Thanks!

Re: Using Heuristic algorithm in GAMS

Posted: Sat Jun 15, 2019 4:15 pm
by bussieck
GAMS has the solver LocalSolver connected that implements a local search algorithm. If you want to use external algorithms it is relatively easy if your model is simple and can be described by a few sets and parameters: Just export the data to GDX, read it in to Matlab and pass it on to the algorithm in an appropriate form. If you want to pass on GAMS equations algebra and variables (a model instance that is generated with a solve statement), this is much harder. You will need to access the model instance (and the equation logic) via some API. The COIN-OR GAMSLinks project (https://projects.coin-or.org/GAMSlinks) shows how to do this. The Couenne link takes the GAMS algebra apart to feed this into the solver and can probably serve as a template to connect to a local search algorithm. This is not easy...

-Michael

Re: Using Heuristic algorithm in GAMS

Posted: Sat Jun 15, 2019 5:25 pm
by linkho
Hi Michael as always many thanks!