In order to compile your C++ project with Gurobi, you first need to create the appropriate libgurobi_c++.a compatible with your g++ version. To do so, access the following directory and compile it:
The file is now created, so copy it to the lib folder:
cp libgurobi_c++.a ../../lib/
Now you can create your makefile. For example:
CCC = g++
FLAGS = -g -Wall -Wextra
GRBPATH = /[full path to]/gurobi752/
$(CCC) $(FLAGS) code.cpp -o exec -I$(GRBPATH)/linux64/include -L$(GRBPATH)/linux64/lib -lgurobi_c++ -lgurobi75
rm -f code *.o *~
You might need to change spaces to tabs in the above makefile.
This was useful? Buy me a cup of coffee to help me keep this website running!
I have been working on a vehicle routing problem in which the truck transports several commodities, but these are measured in different units. Hence, we know the capacity of the truck for each of these commodities alone, but we don’t know how to convert them into one another so that we can load two commodities and still respect the capacity.
In this tutorial, I show how to setup Gurobi with Xcode. Note you should have installed Xcode from the App Store and have downloaded and installed Gurobi for MacOS.
In my case, I’m running MacOS 10.13.3, Xcode 9.3 and Gurobi 7.5.2.
IBM CPLEX Studio has been free for faculty members for a while, and IBM offers not only CPLEX but many other software for free and for many platforms.
Recently, IBM has streamlined their IBM Academic Initiative systems and CPLEX is now free for faculty/researchers and students.
In this post you will see how to linearize max functions, min functions, and absolute value functions. These can be expressed mathematically as:
In this tutorial I will describe how to configure Apple Xcode to use IBM CPLEX with Concert technology in a C++ project. This tutorial assumes you already have CPLEX installed. If this is not the case, follow the How to Download and Install a full version of CPLEX (for Mac, obviously).
First, start Xcode and select “Create a new Xcode project”. This is also available from the File menu.
In this tutorial I will describe how to configure Microsoft Visual Studio Express to use IBM CPLEX with Concert technology in a C++ project. This tutorial assumes you already have CPLEX installed. If this is not the case, follow the How to Download and Install a full version of CPLEX. If you’re looking for how to use CPLEX with Apple Xcode, follow the How to configure IBM CPLEX with Apple Xcode.
First, open MS Visual Studio and start a new C++ console application. You might want to see How to Install Visual Studio and Create a C++ project.
When your project is created, right click “Project” and select “Properties”.
In this tutorial I will describe how to download and install a full version of IBM ILOG CPLEX Optimization Studio 12.6.1 (the latest version as of now – May 2015).
IBM gives scholars and university researchers free access to its software and systems. This support to our academic research is greatly appreciated. You need to register and apply for the IBM Academic Initiative program, through IBM Academic Initiative.
When you receive the confirmation of your eligibility, you can login and click on “Access IBM software and systems”, which will allow you to search for whatever IBM product you want. Here, I was looking for “CPLEX”. A list of CPLEX versions appears in the pop-up list, I clicked on CPLEX 12.6.1, the latest one.
In this tutorial I will describe how to install Microsoft Visual Studio Express 2012.
Start by downloading MS Visual Studio Express 2012 for free from MS Visual Studio Express 2012. Install the downloaded file as shown in the picture below.
Often when writing a model, the most straightforward way of writing a constraint is by multiplying two variables. Then, in order to solve the model we need to linearize it. There comes the problem, as I always have problems reminding how to linearize a product of variables.
Linearizing the product of two binary variables
Suppose your model has the product , where , and are binary. There is an easy way of linearizing that equation. Add the three inequalities below