R: lazy load DB files
R can read data very fast and conveniently from .Rdata files. E.g.> load("indus89.rdata")> length(ls())[1] 275For this data set we have a lot of data: 275 objects are loaded:If we just want to...
View ArticleSelf-descriptive number
In http://stackoverflow.com/questions/35485185/puzzle-taken-from-gardner a small problem is given:This is called a self-descriptive number.Of course we can use a MIP solver instead of Prolog:The...
View ArticleQuadprog: R vs Javascript
RThe R package quadprog contains a QP (Quadratic Programming) algorithm that solves the following problem:\[ \begin{align} \min\>&\frac{1}{2}x^TQx-d^Tx \\ &A_1^Tx = b_1 \\ &A_2^Tx \ge...
View ArticleCardinality Constrained Portfolio Optimization: MIQP without MIQP Solver
The optimization toolbox of Matlab does not contain an MIQP (Mixed Integer Quadratic Programming) solver. So when they discuss a cardinality constrained portfolio problem (this means only a certain...
View ArticleCeiling function in a Mixed Integer Program
In this post the question was asked how to implement the Ceiling() function in a MIP model. The constraint in question is:\[\left\lceil \frac{x-A}{B} \right\rceil \cdot C + D\cdot x < E...
View ArticleTennis Scheduling
Scheduling models are not always simple to write down. Here someone is quite stuck in the mud trying to implement a scheduling model in the Constraint Programming system Choco. Let’s see if some Math...
View ArticleMore Tennis Scheduling
Consider the case where we want to design a mixed doubles tennis tournament. Mixed doubles means every team consist of one man and one woman. The idea is to have several rounds where we want try to to...
View ArticleReformulate MINLP to MIP
In this post the question came up, what type of solver can handle this problem: \[\begin{align} \max\> & (0.9 x_0 + 0.8 x_1 + 0.85 x_2) \cdot(0.95 x_3 + 0.8 x_4 + 0.7 x_5)\cdot (0.98 x_6 + 0.94...
View ArticleThe Weight Problem of Bachet de Meziriac
In a comment in this post there was a question about the Weight Problem of Bachet de Meziriac. From this description:A merchant had a forty pound weight that broke into four pieces as a result of a...
View ArticleMIP vs Matlab
In this post an interesting problem is posted. I am trying to suggest an optimization model opposed to some heuristic algorithm in Matlab. Looking at the zero points I get for my answer, without much...
View ArticleMicrosoft: Python, R
Python 3 starts to take over Python 2 (finally!)An analysis by Microsoft looking at packages requiring Python 2 or Python 3, gives an indication when Python 3 starts to take over: that is when more...
View ArticleGAMS/Gurobi Announcement
Received from sales@gams.com: Next week we will start to release the distribution 24.7.There is one change, which will also affect your clients using GAMS/Gurobi: Gurobi Optimization, Inc. has decided...
View ArticlePolySCIP: multi-criteria integer programming
http://polyscip.zib.de/Looks interesting. Unfortunately, not being an academic I am not allowed to download it and try it out.
View ArticleR: is.integer and is.wholenumber
It is not the first time that a user is confused with this R output:> is.integer(1)[1] FALSEThe reason is the type of such a number is actually:> typeof(1)[1] "double"The help of is.integer is...
View ArticleLarge assignment problem
I usually solve assignment problems:\[\begin{align} \min\>& \sum_{i,j} c_{i,j} x_{i,j} & \\ & \sum_j x_{i,j} = 1 & \forall i \\ & \sum_i x_{i,j} = 1 & \forall j \\ & x...
View ArticleExam scheduling: Debugging C++ vs Modeling
In this post a question was asked about a small interesting scheduling problem. The model was implemented in C++ using Cplex. Debugging someone else’s C++ code is not my favorite pastime so instead...
View Articleggplot and miptrace
The output of miptrace can be used to plot the MIP bounds. In this post we used it to show the results on an Exam Scheduling Model. After a little bit of clean-up here is a better version:plot.trace...
View ArticleWeb based visualization of multi-criteria model results
Some funding became available to add a Web based visualization tools to a larger engineering design application. Below is a depiction of the architecture. The solution points are (all or many) Pareto...
View ArticleMySQL Import Wizard vs LOAD INFILE
The MySQL workbench has a handy tool to import CSV files:Unfortunately it is extremely slow. Here are some timing figures when compared with the LOAD INFILE command.Timings are in seconds....
View ArticleSmall LP, wrong solution
From http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.optimize.linprog.html: This does not look right. Note: Seems to be fixed in newer versions. My python system seems to do the right...
View Article