Estoy realmente interesado en el análisis numérico. He estado usando la aplicación de código abierto DotNumerics. Mi sistema lineal es el siguiente:Cómo resolver el problema de programación lineal con DotNumerics?
1 * x + 3 * y <= 150
2 * x + 1 * y <= 100
donde x >= 0, y >= 0
z = 10 * x + 15 * y
que estoy tratando de resolver z
(optimización ...)
I can use Simplex method to solve above problem as found in this link. También he enviado un correo electrónico al autor, sin embargo, él no ha respondido.
using DotNumerics.Optimization;
using DotNumerics;
namespace App.SimplexCalcLinearProgramming
{
class Program
{
static void Main(string[] args)
{
Simplex simplex = new Simplex();
double[] initialGuess = new double[2];
initialGuess[0] = 0.1;
initialGuess[1] = 2;
double[] minimum = simplex.ComputeMin(AmacFunction, initialGuess);
minimum.ToList().ForEach(q => Console.Write(q.ToString() + "\n"));
Console.ReadKey();
}
static double AmacFunction(double[] x)
{
/*
* 1 * x + 3 * y <= 150
* 2 * x + 1 * y <= 100
*
* where x >= 0, y >= 0
*
* z = 10 * x + 15 * y
*
* Solve for z
*/
double f = 0;
f = 10*x[0]+15*x[1];
return f;
}
}
}
Ooh, no sabía nada de esa herramienta. Tendré que mirar esto más tarde –
No he usado dotNumerics, pero si se trata de un LP que está tratando de resolver, ¿ha considerado usar el - Microsoft Solver http://msdn.microsoft.com/en-us/library/ ff524509 (v = vs.93) .aspx – Gangadhar