Giter Site home page Giter Site logo

anassmeskini / gph Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 2.0 480 KB

Heuristics for mixed-integer programming

License: MIT License

CMake 5.95% C++ 94.05%
optimization linear-programming mixed-integer-programming integer-programming heuristics operations-research

gph's Introduction

GPH

General-purpose heuristics for mixed-integer programming

Introduction

GPH implements approximation algorithms for quickly finding feasible solutions to problems of the form:

The algorithms implemented are the heuristics usually embedded in MIP solvers. A description of these algorithms can be found here. The heuristics do not require the problem to have any particular structure.

The code is written in C++17 with a simple object-oriented design and provides data structures that allow for an efficient implementation of the algorithms. Additionally, the code is parallelized using the Thread Building Blocks library.

Design

  • The problem data is stored by the class MIP: the constraint matrix is stored in row-major and column-major order as two sparse matrices and the rest of the problem is stored as dense vectors.
  • A feasibility heuristic is a class derived from FeasibilityHeuristic and implements the method run. Similarly, an improvement heuristic is a class derived from ImprovementHeuristic that implements the method improve.
  • The class Search takes a list of heuristics as input and runs them in parallel. If the feasibility heuristics find a solution, it is passed to the improvement heuristics.

Compilation

GPH depends on an external LP solver and the Thread Building Blocks library and uses CMake for compilation. Three LP solvers are supported: Cplex, SoPlex and GLPK. zlib is an optional dependency to read input in gzip format.

Example: compiling with SoPlex

git clone https://github.com/anassmeskini/GPH
mkdir build
cd build
cmake .. -DSOLVER=soplex -DTBB_ROOT=/path/to/tbb
make

If the LP solver is not installed system-wide, the path needs to be provided to cmake (by adding -DSOPLEX_DIR=/path/to/soplex in the example).

Usage

The executable reads plain text and gzip files in MPS format.

SYNOPSIS
        ./gph <input file> [-l <tlimit>] [-t <nthreads>] [-w] [-s <start_sol>] [-c <config>]

OPTIONS
        <tlimit>    time limit in seconds
        <nthreads>  number of threads to use
        -w          write solution to disk
        <start_sol> path to solution to improve
        <config>    configuration file

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.