19

I have been looking for a python module that implements the common techniques of global optimization (finding the global minimum of a function in N dimensions) without success.

If you heard about a simulated annealing or genetic algorithm implementation in python, please share.

Mermoz
  • 14,898
  • 17
  • 60
  • 85

5 Answers5

15

Scipy's optimize module has a dual_annealing function that might fit your needs. Also, you should check out the PyEvolve module for doing a genetic algorithm.

Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
Justin Peel
  • 46,722
  • 6
  • 58
  • 80
7

I'm not an expert, but have you looked at:

Thomas K
  • 39,200
  • 7
  • 84
  • 86
6

One of the most common is scipy.optimize.

For genetic algorithms, there's pygene.

Also, the aima-python project has implementations of algorithms described in Russell and Norvig's "Artificial Intelligence: A Modern Approach".

scoffey
  • 4,638
  • 1
  • 23
  • 27
1

I've been working on a detailed comparison of many python global optimizers (I assume you are interested in derivative-free optimization where there are plenty of local minima).

To summarize, I'd recommend scipy.optimize and if you're in dimension less than say ten, the SHGO algorithm therein is really solid. You might want to read up on it if you have a passing interest in homology. It is better than some previous ones, such as basin-hopping, because it cleverly tries to avoid redundant local searches.

The full list and comparisons are in the report

Peter Cotton
  • 391
  • 2
  • 7
1

Simulated Annealing:

frigidum is a python package for simulated annealing.

Willem Hendriks
  • 1,267
  • 2
  • 9
  • 15