In another post I demonstrated how to develop a heuristic to solve the knapsack problem. We managed to solve the problem quite well and had an optimality gap of about 1%, that is, our solution was 1% away from the optimal solution. Here I’d like to demonstrate, how simple it is to solve the Knapsack… Read more Find optimal Solution to Knapsack Problem with Linear Programming in R

# Category: optimization

## Solve Knapsack Problem with Heuristics in R

In this post I’ll show a way how to solve the Knapsack Problem applying a simple greedy improvement heuristic and how to implement it in R. What is the Knapsack Problem? On Wikipedia, you find the following definition: “The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a… Read more Solve Knapsack Problem with Heuristics in R

## Graph Notation

There are different types of graph notations. Here I’d like to present a nice and compact way in the form of a Vertex Lists and Edge Lists, which I came across during my studies at the MSE in Zurich. [Note: All graph images shown in this post have been taken from graphical representations of graphs… Read more Graph Notation

## Solve TSP Instance using Google OR-Tools

If you happen to have to solve TSPs or some special type of VRPs – i.e. capacitated or with timewindows and other constraints – you might want to have a look at Google OR-Tools. Of course the library can be of use for a much broader set of problems, i.e. to solve Constriant Programming tasks… Read more Solve TSP Instance using Google OR-Tools

## Calculate an MST with Ant Colony Optimization in Python

Ant Colony Optimization is an old but still often applied construction heuristic to develop solutions using nature inspired behavior. The heuristic mimics the behavior of ants when finding shortest paths to between their nests and some kind of attraction, i.e. a food-source. The main idea are the pheromone trails, which ants leave behind, when travelling… Read more Calculate an MST with Ant Colony Optimization in Python

## Tabu Search in R

Here I’ll show you a way, how to do Tabu Search with Steepest Descent with best improvement in R. Tabu Search is a local improvement heuristic used to improve existing solutions. Such heuristics are also called local search heuristics. How does Local Search work? Local search can be described in words as follows: Take initial… Read more Tabu Search in R

## Configure multiple Users for GUROBI Cloud

What is the Objective If you are a small to medium scale solution provider for optimization solutions and want to provide solutions using the world’s best solver, then you should go for GUROBI cloud, since prices are most attractive and management of multiple users is quite simple. You will have to pay something like –… Read more Configure multiple Users for GUROBI Cloud

## Solve TSP using Pilot Method

This post shows a simple implementation using R to solve a given TSP (Traveling Salesperson Problem) instance using the Pilot Method. The whole R script can be accessed here on my gist. How does the Pilot Method work? The Pilot Method is a construction heuristic to build (i.e. initial) solutions. The method tries to avoid… Read more Solve TSP using Pilot Method

## Calling GUROBI from Matlab

In this post I’ll show you the steps you need to take, if you want to use the powerful GUROBI solver from Matlab in order to solve Mixed Integer Linear Programs. Install the GUROBI Solver Go to the Gurobi website, create an account and download the version applicable for your operating system here. Acquire and… Read more Calling GUROBI from Matlab

## Solve Optimization Tasks using GUROBI Cloud

What is the objective here? I will document the steps needed to setup Gurobi to solve a Linear Program in the cloud. For this example we will use a simple linear model and use Matlab to invoke the locally installed Gurobi solver, which in turn would forward it to a Gurobi Compute Server, which we… Read more Solve Optimization Tasks using GUROBI Cloud