software: using genetic algorithms for optimization

2
Software Using genetic algorithms for optimization Chemistry Solver New Light Industries, Ltd. 9713 W. Sunset Highway Spokane, WA 99204 509-456-8321; fax 509-456-8351; nli @ comtch. iea. com; http://www. iea. com/— nli Version 1.0; $375 Genetic algorithms can be used to solve difficult optimization problems with objec- tive functions that do not possess "nice" properties such as continuity, differentia- bility, and so forth. These algorithms maintain and manipulate a population of trial solutions to the optimization problem and implement a survival-of-the-fittest strategy in their search for a solution. Through mating of individual members of the population and exchange of their genes (the elements of the trial solution embedded in each member of the popula- tion), the solution space is explored over successive generations. Members with genes having betterfitnessto solve the problem survive to mate again, leading to improvement in the fitness of the better trial solutions as the population evolves. Gene mutations are also possible, and these, too, can occasionally lead to more fit offspring. This approach permits exploi- tation of several promising areas of the solution space at the same time. Chemistry Solveris one of the relatively few commercial software packages that im- plements genetic algorithms for optimization. It runs on top of a Microsoft Excel spread- sheet, which stores the genes and deter- mines the fitness function for each trial pro- duced by the genetic algorithms. The pro- gram sets the population, performs the mating and exchange of genes, does the mu- tations, and evaluates thefitnessof the mem- bers of the population. It also displays a con- tinuously updated history of the fitness of the population, allows the user to modify the parameters of the genetic algorithm in real time, and updates the Excel spreadsheet as each generation is evaluated. Installation, support, and documentation Chemistry Solver runs under Microsoft Ex- cel, version 4 or higher, on a 386-class PC or higher running Windows 3.1 or Win- dows 95. It requires at least 2 MB RAM, and the software sample takes up about 900 KB on the hard disk. Installation of the single floppy disk containing the software is automated from a setup program and proceeds without problem. Chemistry Solver ran well with either Excel version 5 or Excel 95. The cou- pling of Chemistry Solver and Excel was tight, and execution of the optimizations went as expected. A problem suited to optimization by genetic algorithms often involves a fair amount of computation, and Excel is not the fastest of programming languages, so it is not surprising that per- formance was not very impressive under Windows 95 on a 66-MHz 80486 machine with 16 MB RAM. Execution of the same problem under Windows 95 on a 90-MHz Pentium machine with 32 MB RAM was adequate—aboutfivetimes faster than on the slower machine. The software is not removable through the Windows 95 con- trol panel, but the installation places all Chemistry Solver displays a continuously updated history of the fitness of the population along with status and problem definition windows. 678 A Analytical Chemistry News & Features, November 1, 1996

Upload: steven-d

Post on 11-Feb-2017

220 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Software: Using genetic algorithms for optimization

Software

Using genetic algorithms for optimization

Chemistry Solver New Light Industries, Ltd. 9713 W. Sunset Highway Spokane, WA 99204 509-456-8321; fax 509-456-8351; nli @ comtch. iea. com;

http://www. iea. com/— nli Version 1.0; $375

Genetic algorithms can be used to solve difficult optimization problems with objec­tive functions that do not possess "nice" properties such as continuity, differentia­bility, and so forth. These algorithms maintain and manipulate a population of trial solutions to the optimization problem and implement a survival-of-the-fittest strategy in their search for a solution. Through mating of individual members of the population and exchange of their genes (the elements of the trial solution embedded in each member of the popula­tion), the solution space is explored over successive generations. Members with genes having better fitness to solve the problem survive to mate again, leading to improvement in the fitness of the better trial solutions as the population evolves. Gene mutations are also possible, and these, too, can occasionally lead to more fit offspring. This approach permits exploi­tation of several promising areas of the solution space at the same time.

Chemistry Solveris one of the relatively few commercial software packages that im­plements genetic algorithms for optimization. It runs on top of a Microsoft Excel spread­

sheet, which stores the genes and deter­mines the fitness function for each trial pro­duced by the genetic algorithms. The pro­gram sets the population, performs the mating and exchange of genes, does the mu­tations, and evaluates the fitness of the mem­bers of the population. It also displays a con­tinuously updated history of the fitness of the population, allows the user to modify the parameters of the genetic algorithm in real time, and updates the Excel spreadsheet as each generation is evaluated.

Installation, support, and documentation Chemistry Solver runs under Microsoft Ex­cel, version 4 or higher, on a 386-class PC or higher running Windows 3.1 or Win­dows 95. It requires at least 2 MB RAM, and the software sample takes up about 900 KB on the hard disk.

Installation of the single floppy disk containing the software is automated from a setup program and proceeds without problem. Chemistry Solver ran well with either Excel version 5 or Excel 95. The cou­pling of Chemistry Solver and Excel was tight, and execution of the optimizations went as expected. A problem suited to optimization by genetic algorithms often involves a fair amount of computation, and Excel is not the fastest of programming languages, so it is not surprising that per­formance was not very impressive under Windows 95 on a 66-MHz 80486 machine with 16 MB RAM. Execution of the same problem under Windows 95 on a 90-MHz Pentium machine with 32 MB RAM was adequate—about five times faster than on the slower machine. The software is not removable through the Windows 95 con­trol panel, but the installation places all

Chemistry Solver displays a continuously updated history of the fitness of the population along with status and problem definition windows.

678 A Analytical Chemistry News & Features, November 1, 1996

Page 2: Software: Using genetic algorithms for optimization

files in one location, and manual removal is straightforward.

Chemistry Solver offers several methods for gene evolution though mating and mu­tation. The common two-point crossover and an unusual permutation crossover method permit exchange of genes in mat­ing. Mate selection is based on a graduated roulette wheel method. Random mutation, random mutation with a hill climb, or direc­tional hill climb mutation can be selected to generate population diversity. The mutation probability and size are adjustable. The size of the population and the size of the set of "fittest" members who create the next gener­ation are also adjustable. The program has default values, but the user can change these defaults to suit the problem. Pull-down menus permit selection of the various param­eters controlling the genetic algorithm. The genes are defined by named cells in the Excel spreadsheet Another pull-down submenu is used to connect genes in the genetic algo­rithm software with the named cells in Excel. Integer or real-number values can be se­lected for genes, and ranges for acceptable mutations are specified here. The goal of the search (a maximum, a minimum, or a spe­cific, user-selectable value) and the exit con­ditions (based on run time, stability of the fitness function, or number of generations examined) are also specified.

The solver module has a standard, Mi­crosoft-like user interface with a toolbar, a help menu, a minimizable history graph, and a status window. Like Excel, the solver has a status line at the bottom of the solver window. The status line keeps track of the state of the software, the generation, the elapsed time, and the best fitness achieved from the evolutionary search. The history graph can display the best the median, and/or the worst fitness result of the popu­lation for each generation, and, like the other parameters of the genetic algorithm, the graphical display is easily changed by the user as a run progresses. Hypertext

help on the solver menus, definitions, and hints on the use of the solver are available.

Documentation is provided in a 52-page manual. The manual begins with an overview of the software, provides a sum­mary of the menu selections needed to run two examples, offers practical hints on running the software, gives a brief discus­sion of the theory of the genetic algorithm used in the software, and concludes with a glossary of terms. There is no list of key references on genetic algorithms or on the specific methods used in this package, nor is there reference to the very useful sources of information on genetic algo­rithms available on the Internet.

Tutorial matter for Chemistry Solver is limited to coverage of the two example optimizations. The two examples are similar in that both are chemical applica­tions, but they differ in most other re­spects. The first is a simple task, in which the genetic algorithm is used to balance a chemical equation. The second example, based on the action of the lac operon of Escherichia coli, involves solu­tion of a series of coupled chemical reac­tions involving catalysis and threshold­ing to fit a diauxic growth curve—a much more challenging optimization. Most genetic algorithms require several control parameters to be set because the genes, the details of the exchange of genes in mating, and the nature and fre­quency of mutations must all be speci­fied prior to starting, at least. The man­ual provides only the menu selections needed to solve the two example prob­lems and does not provide the logic and the programmatic details needed to set up the problem for solution by the ge­netic algorithm. A determined student might be able to learn to use the genetic algorithms from careful study of these examples, but the novice will likely need help to make progress, at least in the early stages. Novices will find that the

most useful part of the documentation is the list of practical hints on running the software, but this section, again, places more emphasis on what to do rather than why to do it. Help is available via fax or e-mail, but the manual is not clear on whether the license includes techni­cal support. I found the responses of the technical support staff to questions I posed via e-mail rather slow.

To get the most from this package, the user must be familiar with Excel program­ming. Many of the optimization problems can be expressed through the functions built into Excel, but more complex prob­lems will require substantial additional pro­gramming in Excets Visual Basic program­ming language. There is very little guid­ance in the Chemistry Solver manual on programming using either ExceFs functions or Visual Basic; the user will need to refer to the Excel manuals for the critical back­ground. In principle, the use of Excel as a programming base may permit this pack­age to work with other add-ons to the Excel platform, including ones implementing neu­ral networks and nonlinear least-squares regression. The manual gives no details on the coupling of this and other Excel soft­ware, but it would make the package much more attractive if it could work with other add-ons and if that capability were docu­mented in the manual.

The Chemistry Solver package offers a simple way for those with Excel program­ming experience and an interest in uncon­ventional optimization to get a genetic algorithm working quickly with minimal effort Other than the two examples, there is nothing especially chemical about the Chemistry Solver package, and chemists without prior experience with genetic al­gorithms and Excel programming will find this package no more accessible than oth­ers implementing genetic algorithms.

Reviewed by Steven D. Brown, Univer­sity of Delaware, Newark.

Analytical Chemistry News & Features, November 1, 1996 679 A