Optimization by Problem Partitioning using Simulated Annealing and GAMS ProgrammingBy Dr Muhammad Al-Salamah AbstractWe shown how a difficult optimization problem can be converted into two subproblems, on the hope that it will be easier to solve. One subproblem is solved using a meta-heuristic procedure, simulated annealing in the current case, and the other will be solved using one of the solvers available under GAMS. Simulated Annealing in OptimizationSimulated annealing has been used extensively in optimization, in which the problem is nonlinear with large number of constraints, discontinuous functions of either objective function or constraints, or large MIP. The motivation of simulated annealing and the steps of the procedure can be found in many books and websites. We concentrate here only on programming simulated annealing under GAMS environment. Simulated annealing has been successfully applied to solve unconstrained optimization problems with simple bounds. Problems with constraints are not natural extension of unconstrained problems, and they required conditioning before simulated annealing can be used to derive an acceptable solution to them. One conditioning technique that has been widely used is the penalty functions technique, by which the constrained problem is converted to a problem with penalty terms to the objective function for violating the constraints. Some commercial optimization packages utilize this technique. We show how an optimization problem can be converted into two subproblems that are linked by one variable. This variable is the decision variable for one subproblem and parameter for the another subproblem. One of the subproblems is an unconstrained problem with simple bounds and the other subproblem is a more complicated problem with the original constraints. Optimization ProblemConsider the constrained optimization problem NLPO
This problem has three variables, and clearly it is nonlinear in objective function and two of the three constraints. The solution of this problem is easy to get, given the power we have from modern solvers. But, we will use this problem to illustrate problem partitioning and the simulated code in GAMS code. Consider the problem again, and notice that it can be partitioned into two optimization problems as follows. There are three variables x1, x2, and x3; and any one of them can be the link variable between the two subproblems. It will be better if x3 is chosen to be the link variable, since it appears only once the problem and also its order is one. If one of the other variables x1 or x2 is picked up for the link variable, then it is very hard to predict whether the optimization of the subproblems is going to converge to a reasonable solution. Let y = x3 and the problem NLPO becomes:
Therefore, the two subproblems are: Subproblem 1:
Subproblem 2:
Subproblem 1 consists of a univariate function with simple bounds. The bounds l and u are chosen carefully so they do not interfere when finding the optimal value of y. Subproblem 2 is easier to solve the original problem NLPO since it has one variable less. Solution Procedure of Simulated AnnealingThe solution procedure to solve NLPO involves solving the two subproblems iteratively. Subproblem 1 has only simple bounds, hence simulated annealing now can be used to solve it. Subproblem 2 can be solved now with less effort utilizing one of NLP solvers available under GAMS environment. The illustration of the solution procedure is shown below.
Simulated Annealing GAMS CodeThe GAMS code incorporating simulated annealing and calling NLP GAMS solver to solve problem NLPO is:
option seed=4; Simulated Annealing SolutionThe solution of the problem NLPO using BARON solver is
In the above code, the bounds on y have been put at -20 and 20. The solution of the partitioned problem using the combination of simulated annealing and GAMS solver is
For this particular case, the time it took the solver to solve NLPO is about zero (very short). However, the partitioned problem needed 3 seconds to solve. The solution time of simulated annealing is dependent on the size of the outer and inner loop of the procedure; hence, solution time vs quality of solution time has to be balanced. Created in 2008 |