Gravity is an open source, scalable, memory efficient modeling language for solving mathematical models in Optimization and Machine Learning. It exploits structure to reduce function evaluation time including Jacobian and Hessian computation. Gravity is implemented in C++ with a flexible interface allowing the user to specify the numerical accuracy of variables and parameters and can handle arbitrary Mixed-Integer Nonlinear Programs (MINLPs) as well as Semidefinite Programs (SDPs). It is also designed to offer efficient iterative model solving, convexity detection, multithreading of subproblems, and lazy constraint generation. When compared to state-of-the-art modeling languages such as JuMP, Gravity is 5 times faster in terms of function evaluation and up to 60 times more memory efficient. Short term goals include Lasserre’s hierarchy implementation for polynomial optimization and automatic symbolic variable elimination for MINLPs.

Gravity currently handles MINLPs that can be formulated using the form below:

   min     f(x)

s.t.       g_L <= g(x) <= g_U
           x_L <=  x   <= x_U
           x_i in Z for all i in I and,
           x_i in R for all i not in I.

where f(x): R^n --> R, g(x): R^n --> R^m are twice continuously differentiable functions and I is a subset of {1,..,n} .

Gravity is distributed under the opensource BSD-3 Clause license (BSD-3) on COIN-OR. The BSD-3 license is approved by the OSI (Open Source Initiative), thus Gravity is OSI Certified Open Source Software.

For short download and installation instruction see

More information and links can be found on

Authors of the code

Project manager: Hassan Hijazi


  • Guanglei Wang
  • Ksenia Bestuzheva
  • Smitha Gopinath
  • Mertcan Yetkin

Improve this page, report a bug, contribute to Gravity

As an open-source code, contributions to Gravity are welcome. To submit a contribution to Gravity please follow the COIN-OR guidelines.

The preferred way to report a bug is to use the ticket system. To report a bug using this system:

  1. Register and login,
  2. Report a bug.

As all Wiki pages, this page is editable, this means that you can modify the contents of this page simply by using your web-browser. First register and login then simply click on the "Edit this page" link at the bottom of the page. WikiFormatting will give you a detailed description of available Wiki formatting commands.

Last modified 2 years ago Last modified on Jan 14, 2020 9:22:59 PM

Attachments (3)

Download all attachments as: .zip