Using Heuristic algorithm in GAMS Topic is solved

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
User avatar
linkho
User
User
Posts: 15
Joined: 5 years ago

Using Heuristic algorithm in GAMS

Post 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!
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Using Heuristic algorithm in GAMS

Post 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
User avatar
linkho
User
User
Posts: 15
Joined: 5 years ago

Re: Using Heuristic algorithm in GAMS

Post by linkho »

Hi Michael as always many thanks!
Post Reply