Open source alternative to MATLAB's fmincon function?
<p>Is there an open-source alternative to MATLAB's <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/optim/index.html?/access/helpdesk/help/toolbox/optim/ug/fmincon.html"><code>fmincon</code></a> function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / <a href="http://numpy.scipy.org/">NumPy</a> / <a href="http://www.scipy.org/">SciPy</a> and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any language will do.</p>

<p>Is your problem convex?  Linear? Non-linear?  I agree that SciPy.optimize will probably do the job, but fmincon is a sort of bazooka for solving optimization problems, and you'll be better off if you can confine it to one of the categories below (in increasing level of difficulty to solve efficiently)</p>

<p>Linear Program (LP)
Quadratic Program (QP)
Convex Quadratically-Constrained Quadratic Program (QCQP)
Second Order Cone Program (SOCP)
Semidefinite Program (SDP)
Non-Linear Convex Problem 
Non-Convex Problem</p>

<p>There are also combinatoric problems such as Mixed-Integer Linear Programs (MILP), but you didn't mention any sort of integrality constraints, suffice to say that they fall into a different class of problems.</p>

<p>The CVXOpt package will be of great use to you if your problem is convex.  </p>

<p>If your problem is not convex, you need to choose between finding a local solution or the global solution.  Many convex solvers 'sort of' work in a non-convex domain.  Finding a good approximation to the global solution would require some form Simulated Annealing or Genetic Algorithm.  Finding the global solution will require an enumeration of all local solutions or a combinatorial strategy such as Branch and Bound.</p>
