[ojAlgo-user] IntegerSolver issue
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Simon G. <si...@ya...> - 2012-07-19 21:20:00
|
Hi, my name is Simon I'm trying to use the integer solver in OjAlgo, but I don't understand how to use it. The builder seems to require an ExpressionsBasedModel, which in itself requires a Variable vector. Can you help me out with this? Or point me to an example or documentation regarding this? I'm solving min -[X]T[P] / [C]T[X] and [C]T[X] <= maxCost Where [X] is an integer vector [P] is a vector of real values [C] is a vector of real values maxCost is a real value That is, I want X to maximize [X]T[P] and minimize [C]T[X] while remaining under maxCost I've used the Quadratic solver before, this is how I used it: final QuadraticSolver.Builder tmpBuilder = new QuadraticSolver.Builder(tmpQ, tmpC).equalities(tmpAE, tmpBE).inequalities(tmpAI, tmpBI); final QuadraticSolver tmpSolver = tmpBuilder.build(); final OptimisationSolver.Result tmpResult = tmpSolver.solve(); final BasicMatrix tmpSolution = tmpResult.getSolution(); Where I built the MatrixStore objects using: final MatrixStore<Double> tmpQ = PrimitiveDenseStore.FACTORY.copy(Q); for example... Thanks a lot for any help! S |