Question

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?

Was it helpful?

Solution

Here are a few free and open source c# implementrions

  • Nelder Mead Simplex implementation [Alternate Link]
  • 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)

OTHER TIPS

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

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top