Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CoinMP - Open Source Solver        New CoinMP Release 1.6: A Simple Free C-API Windows DLL andUnix Solver Library (LP/MIP)...
Presentation Overview•   Why Callable Library of COIN?•   What COIN functionality is supported?•   Supported Platforms•   ...
Why Callable Library Version of COIN?Main Design Goals for CoinMP:   •   Easy to use   •   High portability   •   No requi...
What COIN functionality is supported?• Objects   • ClpSimplex   • CbcModel   • OsiClpSolverInterface• Callbacks   • CBMess...
Supported Platforms for CoinMP• Microsoft Windows   • Microsoft Visual Studio (v2008)   • Cygwin/gcc   • MinGW/gcc   • MSy...
Why implemented as C-API?• Standard interface   • Well established   • Easy portability   • Simple to learn• High portabil...
Standard Solver API InterfacesAll Solver Interfaces need to meet certain minimum requirements:•   Loading and Initializing...
CoinMP C-API - Initialization#ifndef _COINMP_H_#define _COINMP_H_SOLVAPI int        CoinInitSolver(char* LicenseStr);SOLVA...
CoinMP C-API – Loading ProblemSOLVAPI int    CoinLoadProblem(HPROB hProb, int ColCount, int RowCount,    int NZCount, int ...
CoinMP C-API - SolvingSOLVAPI int   CoinSetMsgLogCallback(HPROB hProb, MSGLOGCALLBACK MsgLogCallback);SOLVAPI int   CoinSe...
CoinMP C-API – File/Option HandlingSOLVAPI int    CoinReadFile(HPROB hProb, int FileType, char* ReadFilename);SOLVAPI int ...
CoinMP C-API – StochasticSOLVAPI int CoinLoadStochStages(HPROB hProb, int StageCount, int* VarStages,    int* ConStages, c...
New Release 1.6 of CoinMP• New additions to the CoinMP API Interface   • String arguments   • Additional Option functions ...
Future Release 2.0 of CoinMP• Add new solver drivers to CoinMP   • OSI (DyLP, Volume, etc.)   • Symphony   • SMI (Stochast...
Upcoming SlideShare
Loading in …5
×

Seminar: CoinMP - Open Source Solver - Nov 2011

1,216 views

Published on

  • Be the first to comment

  • Be the first to like this

Seminar: CoinMP - Open Source Solver - Nov 2011

  1. 1. CoinMP - Open Source Solver New CoinMP Release 1.6: A Simple Free C-API Windows DLL andUnix Solver Library (LP/MIP) based on COIN Presented by Bjarni Kristjansson Maximal Software, Inc. Copyright © 2011 Maximal Software, Inc. All rights reserved 1
  2. 2. Presentation Overview• Why Callable Library of COIN?• What COIN functionality is supported?• Supported Platforms• Why implemented as C-API?• Description of the C-API interface• New upcoming release 1.6 of CoinMP• Future release 2.0 of CoinMP• Other open source solvers (GLPK, LPSolve)• Recent News and Trends in Optimization• New Academic/Free Development Programs Copyright © 2011 Maximal Software, Inc. All rights reserved 2
  3. 3. Why Callable Library Version of COIN?Main Design Goals for CoinMP: • Easy to use • High portability • No requirement to compile • Larger number of potential users • Can be used from any other application Some users just want to use binaries! Copyright © 2011 Maximal Software, Inc. All rights reserved 3
  4. 4. What COIN functionality is supported?• Objects • ClpSimplex • CbcModel • OsiClpSolverInterface• Callbacks • CBMessageHandler • CBIterHandler • CBNodeHandler• Cuts • GglProbing, CglGomory, CglKnapsackCover, CglOddHole, CglClique, CglLiftAndProject, CglSimpleRounding• Algorithmic • Pivot Algorithms, Scaling, Crash, Perturbation, Primal/Dual, Barrier, Presolve, etc.• Option Parameters Copyright © 2011 Maximal Software, Inc. All rights reserved 4
  5. 5. Supported Platforms for CoinMP• Microsoft Windows • Microsoft Visual Studio (v2008) • Cygwin/gcc • MinGW/gcc • MSys/cl• Unix • Linux/gcc • OSX/gcc • SunOS/gcc Copyright © 2011 Maximal Software, Inc. All rights reserved 5
  6. 6. Why implemented as C-API?• Standard interface • Well established • Easy portability • Simple to learn• High portability to other programming languages • Visual Basic • Java • C++ • C#/VB.Net • Scripting• Not object oriented! Copyright © 2011 Maximal Software, Inc. All rights reserved 6
  7. 7. Standard Solver API InterfacesAll Solver Interfaces need to meet certain minimum requirements:• Loading and Initializing the solver DLL• Query Solver Information• Create/Free Problem Object• Load Problem Elements (matrix, init, integer, priority, semi-cont, SOS, quadratic, nonlinear, stochastic)• Setup Callbacks/Log Handlers• Optimize Problem• Get Solution Values and Statistics (attributes)• File Handling (logs, basis, MPS, LP, XML, etc.)• Option Parameters (get, set)Use existing standard interfaces – Do not reinvent the wheel! Copyright © 2011 Maximal Software, Inc. All rights reserved 7
  8. 8. CoinMP C-API - Initialization#ifndef _COINMP_H_#define _COINMP_H_SOLVAPI int CoinInitSolver(char* LicenseStr);SOLVAPI int CoinFreeSolver(void);SOLVAPI int CoinGetSolverName(char* SolverName, int buflen);SOLVAPI int CoinGetVersionStr(char* VersionStr, int buflen);SOLVAPI double CoinGetVersion(void);SOLVAPI int CoinGetFeatures(void);SOLVAPI int CoinGetMethods(void);SOLVAPI double CoinGetInfinity(void);SOLVAPI HPROB CoinCreateProblem(char *ProblemName);SOLVAPI int CoinUnloadProb(HPROB hProb); Copyright © 2011 Maximal Software, Inc. All rights reserved 8
  9. 9. CoinMP C-API – Loading ProblemSOLVAPI int CoinLoadProblem(HPROB hProb, int ColCount, int RowCount, int NZCount, int RangeCount, int ObjectSense, double ObjectConst, double* ObjectCoeffs, double* LowerBounds, double* UpperBounds, char* RowType, double* RHSValues, double* RangeValues, int* MatrixBegin, int* MatrixCount, int* MatrixIndex, double* MatrixValues, char** ColNames, char** RowNames, char* ObjectName);SOLVAPI int CoinLoadInitValues(HPROB hProb, double* InitValues);SOLVAPI int CoinLoadInteger(HPROB hProb, char* ColumnType);SOLVAPI int CoinLoadPriority(HPROB hProb, int PriorCount, int* PriorIndex, int* PriorValues, int* BranchDir);SOLVAPI int CoinLoadSemiCont(HPROB hProb, int* SemiCount, int* SemiIndex);SOLVAPI int CoinLoadSos(HPROB hProb, int SosCount, int SosNZCount, int* SosType, int* SosPrior, int* SosBegin, int* SosIndex, double* SosRef);SOLVAPI int CoinLoadQuadratic(HPROB hProb, int* QuadBegin, int* QuadCount, int* QuadIndex, double* QuadValues);SOLVAPI int CoinLoadNonLinear(HPROB hProb, int NlpTreeCount, int NlpLineCount, int* NlpBegin, int* NlpOper, int* NlpArg1, int* NlpArg2, int* NlpIndex1, int* NlpIndex2, double* NlpValue1, double* NlpValue2); Copyright © 2011 Maximal Software, Inc. All rights reserved 9
  10. 10. CoinMP C-API - SolvingSOLVAPI int CoinSetMsgLogCallback(HPROB hProb, MSGLOGCALLBACK MsgLogCallback);SOLVAPI int CoinSetIterCallback(HPROB hProb, ITERCALLBACK IterCallback);SOLVAPI int CoinSetMipNodeCallback(HPROB hProb, MIPNODECALLBACK MipNodeCallback);SOLVAPI int CoinOptimizeProblem(HPROB hProb, int Method);SOLVAPI int CoinGetSolutionStatus(HPROB hProb);SOLVAPI int CoinGetSolutionText(HPROB hProb, int SolutionStatus, char* SolutionText, int buflen);SOLVAPI double CoinGetObjectValue(HPROB hProb);SOLVAPI double CoinGetMipBestBound(HPROB hProb);SOLVAPI int CoinGetIterCount(HPROB hProb);SOLVAPI int CoinGetMipNodeCount(HPROB hProb);SOLVAPI int CoinGetSolutionValues(HPROB hProb, double* Activity, double* ReducedCost, double* SlackValues, double* ShadowPrice);SOLVAPI int CoinGetSolutionRanges(HPROB hProb, double* ObjLoRange, double* ObjUpRange, double* RhsLoRange, double* RhsUpRange);SOLVAPI int CoinGetSolutionBasis(HPROB hProb, int* ColStatus, double* RowStatus); Copyright © 2011 Maximal Software, Inc. All rights reserved 10
  11. 11. CoinMP C-API – File/Option HandlingSOLVAPI int CoinReadFile(HPROB hProb, int FileType, char* ReadFilename);SOLVAPI int CoinWriteFile(HPROB hProb, int FileType, char* WriteFilename);SOLVAPI int CoinOpenLogFile(HPROB hProb, char* LogFilename);SOLVAPI int CoinCloseLogFile(HPROB hProb);SOLVAPI int CoinGetOptionCount(HPROB hProb);SOLVAPI int CoinGetOptionInfo(HPROB hProb, int OptionNr, int* OptionID, int* GroupType, int* OptionType, char* OptionName, char* ShortName, int buflen);SOLVAPI int CoinGetIntOptionMinMax(HPROB hProb, int OptionNr, int* MinValue, int* MaxValue);SOLVAPI int CoinSetRealOptionMinMax(HPROB hProb, int OptionNr, double* MinValue, double* MaxValue);SOLVAPI int CoinGetIntOption(HPROB hProb, int OptionID);SOLVAPI int CoinSetIntOption(HPROB hProb, int OptionID, int IntValue);SOLVAPI double CoinGetRealOption(HPROB hProb, int OptionID);SOLVAPI int CoinSetRealOption(HPROB hProb, int OptionID, double RealValue);SOLVAPI int CoinGetStringOption(HPROB hProb, int OptionID, char* StringValue, int buflen);SOLVAPI int CoinSetStringOption(HPROB hProb, int OptionID, char* StringValue); Copyright © 2011 Maximal Software, Inc. All rights reserved 11
  12. 12. CoinMP C-API – StochasticSOLVAPI int CoinLoadStochStages(HPROB hProb, int StageCount, int* VarStages, int* ConStages, char** StageNames);SOLVAPI int CoinLoadStochTree(int ScenCount, int TreeType, int* TreeData, int* TreeData2);SOLVAPI int CoinLoadStochScen(HPROB hProb, int ScenCount, double* ProbData, int *TreeStageStart, int* ProbData, int* ScenBegin, int RandomCount, int *RandomCol, int *RandomRow, double *RandomData, char** ScenNames);SOLVAPI int CoinLoadStochIndep(HPROB hProb, int IndepCount, int* RandomCol, int* RandomRow, int* OutcomeCounts, int EventCount, double *ProbData, double *RandomData, char** IndepNames, char** OutcomeNames, char** EventNames);SOLVAPI int CoinLoadStochBlocks(HPROB hProb, int IndepCount, int* OutcomeCounts, int EventCount, double *ProbData, int* RandomCol, int* RandomRow, double *RandomData, char** IndepNames, char** OutcomeNames, char** EventNames); Copyright © 2011 Maximal Software, Inc. All rights reserved 12
  13. 13. New Release 1.6 of CoinMP• New additions to the CoinMP API Interface • String arguments • Additional Option functions • Attribute handling (Gurobi style)• CoinMP.cpp broken into separate modules: • CoinProblem.c • CoinOption.c • CoinAttr.c • CoinSolver.c • CoinCbc.cpp (driver) • CoinResult.c• Preparations for the ability to support additional solvers• New example codes for Visual Basic, C#, and Java Copyright © 2011 Maximal Software, Inc. All rights reserved 13
  14. 14. Future Release 2.0 of CoinMP• Add new solver drivers to CoinMP • OSI (DyLP, Volume, etc.) • Symphony • SMI (Stochastic) • IPOPT • CppAD • OS • Other• Ability to switch between different solvers• Challenges • More dependencies (checkout / compile) • Third-party libraries (Blas, HSL, Lapack, Mumps) • Complicates the release cycle (coordination issues) Copyright © 2011 Maximal Software, Inc. All rights reserved 14

×