views:

496

answers:

4

Is there any optimization library in C#?

I have to optimize a complicated equation in excel, for this equation there are a few coefficients. And I have to optimize them according to a fitness function that I define. So I wonder whether there is such a library that does what I need?

A: 

There do seem to be many different optimization libraries for C#. This one appears to be the most popular, however.

They do offer a trial version, so you can verify that it will work for your particular situation before purchasing.

Dustin Hoffman
+2  A: 

Here are a few free and open source c# implementrions

  • Nelder Mead Simplex implementation
  • Numerical provides a variety of algorithms including:
    • Chromosome Manager
    • Genetic Optimizer
    • Hill Climbing Optimizer
    • Maximizing Point
    • Maximizing PointFactoy
    • Maximizing Vector
    • Minimizing Point
    • Minimizing Point Factory
    • Minimizing Vector
    • Multi Variable General Optimizer
    • Multi Variable Optimizer
    • One Variable Function Optimizer
    • Optimizing Bracket Finder
    • Optimizing Point
    • Optimizing Point Factory
    • Optimizing Vector
    • Simplex Optimizer
    • Vector Chromosome Manager
    • Vector Genetic Optimizer
    • Vector Projected Function
  • DNAnalytics
    • Done as both a pure managed solution and as a thin wrapper over the Intel unmanaged code.
    • is being merged into MathNetNumerics

More can be found at this list

Note that optimizers frequently benefit from the more extreme code (or assembly) optimizations that are not really possible in pure managed c#. IF serious speed is a concern then targeting an unmanaged implementation like NAG or MOSEK may well provide significant benefits that outweigh the hassle of making the data accessible to the unmanaged API (pinning the managed buffer or using memory mapped files for example)

ShuggyCoUk
+1  A: 

One option is Microsoft Solver Foundation, also has an express edition

jeroenh
A: 

Microsoft Solver Foundation supports any .NET language including C# and the express version is free (subject to some limitations)

http://code.msdn.microsoft.com/solverfoundation

Nigel