All Projects → alberto-santini → cplex-example

alberto-santini / cplex-example

Licence: GPL-3.0 license
Solving a TSP with the CPLEX C++ API.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to cplex-example

Optaplanner
AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assignment, maintenance scheduling, conference scheduling and other planning problems.
Stars: ✭ 2,454 (+6035%)
Mutual labels:  optimization, solver, traveling-salesman
tsp-essay
A fun study of some heuristics for the Travelling Salesman Problem.
Stars: ✭ 15 (-62.5%)
Mutual labels:  traveling-salesman, tsp, travelling-salesman
Angler
Frequency-domain photonic simulation and inverse design optimization for linear and nonlinear devices
Stars: ✭ 75 (+87.5%)
Mutual labels:  optimization, solver
Cosmo.jl
COSMO: Accelerated ADMM-based solver for convex conic optimisation problems (LP, QP, SOCP, SDP, ExpCP, PowCP). Automatic chordal decomposition of sparse semidefinite programs.
Stars: ✭ 149 (+272.5%)
Mutual labels:  optimization, solver
Scikit Opt
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)
Stars: ✭ 2,791 (+6877.5%)
Mutual labels:  optimization, tsp
optimization
Routing optimization module module for Itinero.
Stars: ✭ 47 (+17.5%)
Mutual labels:  optimization, tsp
Osqp
The Operator Splitting QP Solver
Stars: ✭ 689 (+1622.5%)
Mutual labels:  optimization, solver
Hiop
HPC solver for nonlinear optimization problems
Stars: ✭ 75 (+87.5%)
Mutual labels:  optimization, solver
python-tsp-simulated-annealing
Visualisation of Simulated Annealing algorithm to solve TSP
Stars: ✭ 41 (+2.5%)
Mutual labels:  traveling-salesman, tsp
Multiple-Vehicle-Routing
Simple MVR simulation
Stars: ✭ 27 (-32.5%)
Mutual labels:  traveling-salesman, tsp
optaplanner-quickstarts
OptaPlanner quick starts for AI optimization: many use cases shown in many different technologies.
Stars: ✭ 226 (+465%)
Mutual labels:  solver, operations-research
Cppnumericalsolvers
a lightweight C++17 library of numerical optimization methods for nonlinear functions (Including L-BFGS-B for TensorFlow)
Stars: ✭ 638 (+1495%)
Mutual labels:  optimization, solver
Vroom
Vehicle Routing Open-source Optimization Machine
Stars: ✭ 533 (+1232.5%)
Mutual labels:  optimization, solver
Prioritizr
Systematic conservation prioritization in R
Stars: ✭ 62 (+55%)
Mutual labels:  optimization, solver
osqp
The Operator Splitting QP Solver
Stars: ✭ 929 (+2222.5%)
Mutual labels:  optimization, solver
qpmad
ROS-compatible Eigen-based Goldfarb-Idnani quadratic programming solver
Stars: ✭ 41 (+2.5%)
Mutual labels:  optimization, solver
goga
Go evolutionary algorithm is a computer library for developing evolutionary and genetic algorithms to solve optimisation problems with (or not) many constraints and many objectives. Also, a goal is to handle mixed-type representations (reals and integers).
Stars: ✭ 39 (-2.5%)
Mutual labels:  optimization, optimisation
Totsu
First-order conic solver for convex optimization problems
Stars: ✭ 18 (-55%)
Mutual labels:  optimization, solver
CSDP.jl
Julia Wrapper for CSDP (https://projects.coin-or.org/Csdp/)
Stars: ✭ 18 (-55%)
Mutual labels:  optimization, solver
TravelingSalesmanHeuristics.jl
Julia package for simple traveling salesman problem heuristics
Stars: ✭ 46 (+15%)
Mutual labels:  traveling-salesman, tsp

Small CPLEX C++ API tutorial

Prerequisites

  • CPLEX must be installed, of course. Academics can obtain it via the IBM Academic Initiative.
  • You also need a modern version of GCC, that supports at least C++14.

Compile and run

  • Get the code: git clone https://github.com/alberto-santini/cplex-example.git.
  • Move to the new directory: cd cplex-example.
  • Create a build directory: mkdir build.
  • Move to the build directory: cd build.
  • Run cmake: cmake -DCPLEX_ROOT_DIR=</path/to/ilog> -DCMAKE_BUILD_TYPE=Debug ...
    • The path to your CPLEX installation must be such that </path/to/ilog>/cplex/include/ilcplex/cplex.h exists.
    • If your compiler is in a non-standard location, you can use -DCMAKE_CXX_COMPILER=</path/to/compiler>.
    • Change Debug into Release if you want to compile in release mode.
  • Run make: make.
  • Run the executable: ./cplex_example.

Structure

The Graph class (src/graph.h) is a minimal description of a graph; it only stores the number of nodes and the distance matrix. The graph is created randomly, with nodes lying on a plane and euclidean distances. The Solver class (src/solver.h) does all the CPLEX magic: it builds the model, it solves it, and it prints the solution.

License

The present work is distributed under the terms of ghe GNU General Public License v3 (see the LICENSE file).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].