GithubHelp home page GithubHelp logo

pstarszyk / solving-non-linear-optimization-programs Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 277 KB

some fun with reformulating non-convex programs as convex programs

Python 100.00%
convex optimization milp minlp cvxpy

solving-non-linear-optimization-programs's Introduction

Motivation

CVXPY is a very flexible modelling language for solving convex optimization problems in Python. Its API offers users the ability to model mathematical optimization problems very intuitively, and supports numerous solvers that can handle LP, QP, SOCP, SDP, EXP and MIP programs. The challenge for the user is to ensure that their program, if possible, is formulated such that it follows DCP (Disciplined Convex Programming) rules. Many problems in practice can be formulated in convex form at the outset, while others do not lend themselves to such an obvious formulation. Here we consider a problem of MINLP form, demonstrate its reformulation into MILP form through the use of variable relaxations and constraint additions. We then model the program in CVXPY and call the open source GLPK_MI solver. In particular, the non-linearity comes from the product of continuous and binary variables J=X*Z which must be reformulated in the form J'=X'+Z' to satisfy DCP rules. In addition, we deal with Boolean variables Y which are implicitly determined by the values of the continuous decision variables Yโ‰”f(X).

Installation

git clone https://github.com/pstarszyk/solving_MINLP_in_CVXPY.git
cd solving_MINLP_in_CVXPY
pip install -r requirements.txt

Usage

Please see the detailed example in problem.pdf with implementation in implementation.py. In order to use GLPK_MI solver, cvxopt must be installed.

For more detailed information on the CVXPY package, please refer to the documentation.

Steven Diamond and Stephen Boyd, CVXPY: A Python-Embedded Modeling Language for Convex Optimization
https://buildmedia.readthedocs.org/media/pdf/cvxpy/latest/cvxpy.pdf

solving-non-linear-optimization-programs's People

Contributors

pstarszyk avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.