Simple implementation of the 2-phase Simplex Algorithm in Go.
go get github.com/wenbenz/sago
See use example in SimplexTest.go > ExampleLP_Optimize
- Construct a new LP by calling
lp := NewLP() - Call
lp.SetObjectiveFunction(z, a1, a2, ...)to set the objective function to maximize where z = (a1, a2, ...)x - Call
lp.AddConstraint[Eq/Leq/Geq](bi, a1, a2, ...)to add a constraint where bi = (a1, a2, ...)x - Call
Optimizewhen you're ready to go!