Quantcast
Channel: Yet Another Math Programming Consultant
Browsing all 809 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

New Book: R for Data Science; Visualize, Model, Transform, Tidy and Import Data

Recommended introductory text. It discusses some packages I was not really familiar with (like tibble).ContentsPart I. Explore1. Data Visualization with ggplot22. Workflow: Basics3. Data Transformation...

View Article


Image may be NSFW.
Clik here to view.

MIP Starts sometimes disappoint

Modern MIP solvers allow to use a good integer solution to “warm start” the branch and bound process. This looks like a very good approach to cut down on total solution times, and it sometimes is. But...

View Article


Image may be NSFW.
Clik here to view.

Employee Scheduling I: Matlab vs GAMS

In (1) a small employee scheduling problem is modeled as a simple MIP model using MATLAB. Basically from the data on employee availability, we need to form all possible shifts. Even for small data sets...

View Article

Image may be NSFW.
Clik here to view.

Employee Scheduling II: column generation

In (1) and (2) an Employee Scheduling model is considered where all possible shifts are enumerated before we solve the actual model. Although such models models tend to solve quickly (especially...

View Article

Image may be NSFW.
Clik here to view.

Employee Scheduling III: generating all shifts using the Cplex solution pool

In (1) and (2) all possible shifts for a small Employee Scheduling problem are calculated by programming. In (3) we generate new shifts one by one using MIP model as part of a Column Generation...

View Article


MIP modeling: Selecting subsets

Consider the following problem:We have a population of items with values having a mean \(\mu\). Furthermore we have a number of subsets of this population. Each subset \(i\) has a known count \(n_i\)...

View Article

Image may be NSFW.
Clik here to view.

Little trick: random positive definite matrix

Sometimes we want to test a model with some random data. When dealing with quadratic problems we may need to invent a positive definite matrix \(Q\). One simple way to do this is as follows:I.e. in...

View Article

Failing to use optimal solution as initial point

In a somewhat complex non-linear programming model, I observed the following. I do here two solves in a row:solve m2 minimizing zrf using dnlp;solve m2 minimizing zrf using dnlp;We solve the model, and...

View Article


Image may be NSFW.
Clik here to view.

New book: Testing R Code

Table of contentsIntroduction Run-Time Testing with assertiveDevelopment-Time Testing with testthatWriting Easily Maintainable and Testable Code Integrating Testing into Packages Advanced...

View Article


Image may be NSFW.
Clik here to view.

A script to generate power pivot tables

In (1) I provided a script to generate an Excel spreadsheet containing a pivot table that used a CSV file as external data source. Essentially the pivot table provides a view of the data in the CSV...

View Article

Image may be NSFW.
Clik here to view.

Solving Kakuro puzzles as a MIP

The Kakuro puzzle is another logical puzzle similar to Sudoku, KenKen and Takuzu. A small example from (1) is: The rules are as follows:Each (white) cell must be filled with a value \(1,..,9\). Each...

View Article

Multiplication of binary with continuous variable between zero and one

A small tidbit. The standard linearization for the multiplication of two binary variables \(z=x \cdot y\) with \(x,y \in \{0,1\}\) is: \[\boxed{\begin{align}&z\le x\\&z \le y\\& z\ge...

View Article

Python Optimization Modeling: optlang

Example with Transportation Model from (1) taken from the optlang docs:fromoptlangimportVariable,Constraint,Objective,Model# Define problem parameters# Note this can be done using any of Python's data...

View Article


Image may be NSFW.
Clik here to view.

Comparing two GAMS models

I see a lot of GAMS models. Some of them are really beautifully done. Others, I would like to suggest some edits. Here we compare two different models that solve a Kakuro puzzle. The problem from (1)...

View Article

Image may be NSFW.
Clik here to view.

Strict Inequalities in Optimization Models

An often seen question is: Can I write an inequality of the form: \[\sum_i a_i x_i < b \]The obvious answer is no. LP, MIP and NLP solvers only allow \(\le\) and \(\ge\) inequalities. Here are some...

View Article


Running GAMS from Excel

Small demo: Run a GAMS model from Excel.Some VBA code is used to locate the GAMS system, launch GAMS and provide a log window.When visiting clients, whether commercial companies or government agencies...

View Article

Image may be NSFW.
Clik here to view.

Multi-objective model with millions of objectives?

From (1):I have a multi-objective optimization problem [] where I have about 100 millions of lines to maximize or minimize (objective functions).When I searched about which algorithm should I use,...

View Article


Image may be NSFW.
Clik here to view.

ifthen adventures in GAMS (and R)

GAMS has a function ifthen which can be used in equations. For example:e.. y =e= ifthen(x<1,(1+x)/2,sqrt(x));This function implements:\[y=\begin{cases}\displaystyle\frac{1+x}{2}&\text{if...

View Article

Image may be NSFW.
Clik here to view.

More meta-heuristics by combining them

Arguably the number of different meta-heuristics \(N\) is already too large. One simple way to to make this number quickly \(N^2\) is to combine them. Here this is done with Leaping Frogs and...

View Article

Image may be NSFW.
Clik here to view.

Employee Scheduling IV: direct optimization

In (1) a small employee scheduling problem is proposed. It is solved by first generating all possible shifts for each employee, and then solving a very simple MIP (Mixed Integer Programming) model to...

View Article
Browsing all 809 articles
Browse latest View live