Mathematical Programming Computation

, Volume 8, Issue 4, pp 377–391 | Cite as

Customizing the solution process of COIN-OR’s linear solvers with Python

Full Length Paper


Implementations of the simplex method differ mostly in specific aspects such as the pivot rule. Similarly, most relaxation methods for mixed-integer programming differ mostly in the type of cuts and the exploration of the search tree. We provide a scripting mechanism to easily implement and experiment with primal and dual pivot rules for the simplex method, by building upon COIN-OR’s open-source linear programming package CLP, without explicitly interacting with the underlying C\(++\) layers of CLP. In the same manner, users can customize the solution process of mixed-integer linear programs using the CBC and CGL COIN-OR packages by coding branch-and-cut strategies and cut generators in Python. The Cython programming language ensures communication between Python and C\(++\) libraries and activates user-defined customizations as callbacks. Our goal is to emphasize the ease of development in Python while maintaining acceptable performance. The resulting software, named CyLP, has become a part of COIN-OR and is available under open-source terms. For illustration, we provide an implementation of the positive edge rule—a recently proposed rule that is particularly efficient on degenerate problems—and demonstrate how to customize branch-and-cut node selection in the solution of a mixed-integer program.


Linear programming Mixed-integer programming Python Cython COIN-OR CLP CBC CGL Simplex pivot 

Mathematics Subject Classification

90C05 90C10 90C11 


  1. 1.
    Aides, A.: Cython wrapper for IPOPT. Accessed 2 Nov 2011 (Online)
  2. 2.
    Berkelaar, M.: lpsolve, A Mixed Integer Linear Programming Software. Accessed 2 Nov 2011 (Online)
  3. 3.
    Bland, R.G.: New finite pivoting rules for the Simplex method. Math. Oper. Res. 2(2), 103–107 (1977). (ISSN 0364765X)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Carolan, W., Hill, J., Kennington, J., Niemi, S., Wichmann, S.: Empirical evaluation of the KORBX algorithms for military airlift applications. Oper. Res. 38, 240–248 (1990)CrossRefGoogle Scholar
  5. 5.
    CBC: COIN-OR Branch-and-Cut. Accessed 2 Nov 2011 (Online)
  6. 6.
    CGL: COIN-OR Cut Generation Library. Accessed 2 Nov 2011 (Online)
  7. 7.
    Cipra, B.A.: The best of the 20th century: editors name top 10 algorithms. SIAM News 33(4), 1–2 (2000)Google Scholar
  8. 8.
    CLP: COIN-OR Linear Programming. Accessed 2 Nov 2011 (Online)
  9. 9.
    CPLEX: Accessed 2 Nov 2011 (Online)
  10. 10.
    Cython: Accessed 1 Sept 2013 (Online)
  11. 11.
    Dantzig, G.B.: Linear Programming and Extensions. Princeton University Press, NJ (1963)CrossRefMATHGoogle Scholar
  12. 12.
    Dolan, E., Moré, J.: Benchmarking optimization software with performance profiles. Math. Program. B 91, 201–213 (2002)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Dongarra, J., Sullivan, F.: Guest editors’ introduction: the top 10 algorithms. Comput. Sci. Eng. 2, 22–23 (2000). doi: 10.1109/MCISE.2000.8146052. (ISSN 1521-9615)CrossRefGoogle Scholar
  14. 14.
    Forrest, J.J., Goldfarb, D.: Steepest-edge simplex algorithms for linear programming. Math. Program. 57, 341–374 (1992). doi: 10.1007/BF01581089. (ISSN 0025-5610)MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    Goldfarb, D., Reid, J.K.: A practicable steepest-edge simplex algorithm. Math. Program. 12, 361–371 (1977). doi: 10.1007/BF01593804. (ISSN 0025-5610)MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Greenberg, H.J.: An analysis of degeneracy. Naval Res. Log. Q. 33, 635–655 (1986)MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Gurobi: Accessed 2 Nov 2011 (Online)
  18. 18.
    Harris, P.M.J.: Pivot selection methods of the Devex LP code. In: Cottle, R.W., et al., (eds.) Computational Practice in Mathematical Programming, Mathematical Programming Studies, vol. 4, pp. 30–57. Springer, Berlin (1975). doi: 10.1007/BFb0120710 (ISBN 978-3-642-00766-8)
  19. 19.
    Hoffman, K.L., Padberg, M.: Solving airline crew scheduling problems by branch-and-cut. Manag. Sci. 39, 675–682 (1993). doi: 10.1287/mnsc.39.6.657 MATHGoogle Scholar
  20. 20.
    Koepke, H.: Cython wrapper for CPLEX. Accessed 2 Nov 2011 (Online)
  21. 21.
    Koepke, H.: Cython wrapper for lpsolve. Accessed 2 Nov 2011 (Online)
  22. 22.
    Larman, C.: Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, 2nd edn. Prentice Hall, Upper Saddle River (2001)Google Scholar
  23. 23.
    Lougee-Heimer, R.: The common optimization interface for operations research. IBM J. Res. Dev. 47(1), 57–66 (2003). doi: 10.1147/rd.471.0057.
  24. 24.
    Makhorin, A.: GLPK, GNU Linear Programming Kit. Accessed 2 Nov 2011 (Online)
  25. 25.
    Netlib: Accessed 2 Nov 2011 (Online)
  26. 26.
    Numpy: Accessed 1 Sept 2013 (Online)
  27. 27.
    Padberg, M., Rinaldi, G.: A branch-and-cut algorithm for the resolution of large-scale symmetric traveling salesman problems. SIAM Rev. 33, 60–100 (1991). doi: 10.1137/1033004. (ISSN 0036-1445)MathSciNetCrossRefMATHGoogle Scholar
  28. 28.
    PuLP: An LP modeler written in Python. Accessed 2 Nov 2011
  29. 29.
    Python. Accessed 1 Sept 2013 (Online)
  30. 30.
    Raymond, V.,Soumis, F., Metrane, A., Desrosiers, J.: Positive edge: a pricing criterion for the identification of non-degenerate simplex pivots. In: Cahier du GERAD G-2010-61. GERAD, Montreal (2010)Google Scholar
  31. 31.
    Raymond, V., Soumis, F., Orban, D.: A new version of the improved primal simplex for degenerate linear programs. Comput. OR 37(1), 91–98 (2010). doi: 10.1016/j.cor.2009.03.020 MathSciNetCrossRefMATHGoogle Scholar
  32. 32.
    Scipy: Accessed 1 Sept 2013 (Online)
  33. 33.
    Silva, P.J.S.: Pycoin, interface to some COIN packages (2005). Accessed 2 Nov 2011 (Online)
  34. 34.
    SoPlex: An open-source LP solver. Accessed 1 Sept 2013 (Online)
  35. 35.
    Terlaky, T., Zhang, S.: Pivot rules for linear programming: a survey on recent theoretical developments. Ann. Oper. Res. 46–47, 203–233 (1993). doi: 10.1007/BF02096264. (ISSN 0254-5330)MathSciNetCrossRefMATHGoogle Scholar
  36. 36.
    Towhidi, M., Orban, D.: Customizing the solution process of coin-or’s linear solvers with python. In: Cahier du GERAD G-2012-07. GERAD, Montreal (2012)Google Scholar
  37. 37.
    Wächter, A., Biegler, L.T.: On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Math. Programm. 106, 25–57 (2006). doi: 10.1007/s10107-004-0559-y.

Copyright information

© Springer-Verlag Berlin Heidelberg and The Mathematical Programming Society 2015

Authors and Affiliations

  1. 1.Department of Mathematics and Industrial EngineeringÉcole PolytechniqueMontrealCanada
  2. 2.GERADMontrealCanada

Personalised recommendations