# FICO Kaggle Challenge: Santa's Stolen Sleigh // 10 Dec 2015

The analytics company FICO has launched an optimization challenge on Kaggle: Santa's Stolen Sleigh. Here is the problem.

The North Pole is in an uproar over news that Santa's magic sleigh has been stolen. Able to carry all the world's presents in one trip, it was considered crucial to successfully delivering holiday goodies across the globe in one night. Unwilling to cancel Christmas, Santa is determined to deliver toys to all the good girls and boys using his day-to-day, magic-less sleigh. With so little time to pull off this plan, Santa is once again counting on Kagglers to help. Given the sleigh's antiquated, weight-limited specifications, your challenge is to optimize the routes and loads Santa will take to and from the North Pole. And don't forget about Dasher, Dancer, Prancer, and Vixen; Santa is adamant that the best solutions will minimize the toll of this hectic night on his reindeer friends.

In mathematical terms, the problem to solve is related to a kind of Vehicle Routing Problem (VRP). This VRP is large, very large: 100,000 gifts have to be carried by Santa, meaning that 100,000 locations have to be visited once by Santa. Moreover, the objective function of this VRP is very complicated, highly nonlinear, based on the Harversine distance.

Based on the following simple 100-line LSP model, Julien was able to obtain near-optimal results after a few hours of work only. He partitioned the set of gifts into 250 latitude-oriented clusters as shown on the picture above, then running the LocalSolver model given below on each resulting 400-gift VRP instance. Finally, he post-processes the solution through a destroy-and-repair heuristic based on LocalSolver as repairing subroutine. He obtained a solution with cost 12419157215 and ranked 31 among 1100 competitors, while a lower bound with cost 12283416226 is known. Note that the LSP model proposed by Julien uses two nice unique features offered by LocalSolver 6.0: set-based modeling (here the decisional operator "list" is used to model the ordered list of gifts carried during each trip) and black-box expressions (here the function "haversine" is coded externally and plugged to the LocalSolver optimization model using the "call" keyword). To our knowledge, no other optimization solver was able to produce quality solutions to this challenge.

/* santas_stolen_sleigh.lsp */

use io;
use string;
use math;

function haversine(lat1, lon1, lat2, lon2) {
// AVG_EARTH_RADIUS = 6371;
local AVG_EARTH_RADIUS2 = 12742;
lat = lat2 - lat1;
lon = lon2 - lon1;
d = math.pow(math.sin(lat / 2.0),2) + math.cos(lat1) * math.cos(lat2) * math.pow(math.sin(lon / 2),2);
h = AVG_EARTH_RADIUS2 * math.asin(math.sqrt(d));
return h;
}

function input() {
local inFile = io.openRead(inFileName);

// north_pole
position_id[0] = 0;
position_lat[0] = 90 / 180.0 * math.pi;
position_lon[0] = 0.0/ 180.0 * math.pi;
position_weight[0] = 0.0;

pos = 1;
while(inFile.eof() == false) {
local line = inFile.readln();
local tokens = line.split(",");
local id = tokens[0];
local lat = tokens[1].toDouble() / 180.0 * math.pi;
local lon = tokens[2].toDouble() / 180.0 * math.pi;
local weight = tokens[3].toDouble();

position_id[pos] = id;
position_lat[pos] = lat;
position_lon[pos] = lon;
position_weight[pos] = weight;
pos = pos + 1;
}

TRIP_BND = 100;
NB_GIFTS = position_id.count() - 1;
NB_TRIPS = max(1, min(2000, ceil(NB_GIFTS/10)));

BASE_WEIGHT = 10;
MAX_WEIGHT = 1010;
}

function param() {
if(lsTimeLimit == nil) lsTimeLimit = 60;
}

function model() {

constraint partition[i in 1..NB_TRIPS](trip[i]);
for[i in 1..NB_TRIPS]
constraint count(trip[i]) <= min(TRIP_BND, NB_GIFTS);

// weight constraints
for[i in 1..NB_TRIPS] {
total_weight[i] <- BASE_WEIGHT + sum[j in 1..min(TRIP_BND, NB_GIFTS)](position_weight[1+trip[i][j-1]]);
constraint total_weight[i] <= MAX_WEIGHT;
}

// cumulative weight expression
for[i in 1..NB_TRIPS] {
remaining_weight[i][0] <- total_weight[i];
for[j in 1..min(TRIP_BND, NB_GIFTS)-1]
remaining_weight[i][j] <- remaining_weight[i][j-1] - position_weight[1+trip[i][j-1]];
}

// distance
for[i in 1..NB_TRIPS] {
distance[i] <- call(haversine, position_lat[0], position_lon[0], position_lat[1+trip[i][0]], position_lon[1+trip[i][0]]) * total_weight[i]
+ sum[j in 1..(min(TRIP_BND, NB_GIFTS)-1)](call(haversine, position_lat[1+trip[i][j-1]], position_lon[1+trip[i][j-1]], position_lat[1+trip[i][j]], position_lon[1+trip[i][j]]) * remaining_weight[i][j])
+ call(haversine, position_lat[1+trip[i][min(TRIP_BND, NB_GIFTS)-1]], position_lon[1+trip[i][min(TRIP_BND, NB_GIFTS)-1]], position_lat[0], position_lon[0]) * BASE_WEIGHT;
}

minimize sum[i in 1..NB_TRIPS](distance[i]);
}

function output() {
if(solFileName == nil) solFile = io.openWrite("solution.csv");
else solFile = io.openWrite(solFileName);
trip_id = 0;
for[i in 1..NB_TRIPS] {
current_trip = trip[i].value;
if(current_trip.count() > 0) {
for[position in current_trip]
solFile.println(position_id[1+position], ",", trip_id);
trip_id += 1;
}
}
solFile.close();
}

Having installed LocalSolver 6.0 Beta, this LSP code, also available here, can be executed in console as follows:

The original input file "gifts.csv" can downloaded here. By default, the time limit was set to 60 seconds and the output is writen in a file called "solution.csv" that you can submit to the challenge. If you wish to change these parameters, you can do it as follows:

localsolver santas_stolen_sleigh.lsp inFileName=gifts.csv solFileName=foo.csv lsTimeLimit=3600

If you are interested in free trial or academic licenses to run the model above, you just have to register and to follow the instructions given on your account. If you are interested in going further using LocalSolver, we will be pleased to discuss with you: just contact us!

# Other news

## 2018

### LocalSolver is hiring a Numerical Optimization Engineer // 23 Jun 2018

Passionate about numerical optimization? Join a small, fast-growing tech company which is changing the game in the world of optimization.

### LocalSolver is hiring a Full-Stack Developer // 30 May 2018

Passionate about computer programming? Join a small, fast-growing tech company which is changing the game in the world of optimization.

### LocalSolver selected as finalist at Les PROS de la RO // 28 Mar 2018

We are glad to be selected as finalist of the French Operations Research Society competition for the best OR project in industry.

## 2017

### New release: LocalSolver 7.5 // 20 Nov 2017

We are pleased to announce the release of LocalSolver 7.5, which comes with big novelties. Try it for free now!

### Interested in doing an internship at LocalSolver? // 04 Oct 2017

Are you passionate about Operations Research and Mathematical Optimization? Have a look to our internship offers for the year 2018. Then join us!

### LocalSolver sponsors OR2017 in Berlin // 31 Aug 2017

The team will be at the conference OR2017 in Berlin, September 6-8. Come to meet us on our booth, to discover LocalSolver 7.0 new features and applications.

### New release: LocalSolver 7.0 // 02 May 2017

LocalSolver 7.0 offers new features and performance improvements for a bunch of combinatorial and numerical problems. Try it for free now!

## 2016

### Welcome to our new clients // 31 Oct 2016

Several organizations have recently chosen LocalSolver to solve their most challenging optimization problems. Discover companies and institutions who trust us.

### New release: LocalSolver 6.5 // 29 Jul 2016

LocalSolver 6.5 offers big performance improvements for routing & scheduling problems, as well as for almost-linear problems. Check it out for free now!

### Solving a problem with 8 million boolean decisions // 15 Jun 2016

This is the number of binary decisions of the supply chain optimization problem solved in minutes by Pasco Shikishima and Future Architect, using LocalSolver.

### We search for a business developer // 16 Mar 2016

Interested in selling mathematical software? Interested in joining a fast-growing tech company? Have a look to this open position at Innovation 24 & LocalSolver.

### Welcome to our new clients // 01 Mar 2016

Several organizations have recently chosen LocalSolver to solve their most challenging optimization problems. Discover companies and institutions who trust us.

### New release: LocalSolver 6.0 // 09 Feb 2016

LocalSolver 6.0 offers new unique, powerful features: solve routing & scheduling problems at hand using list variables, plug external functions easily to your optimization models, analyze efficiently why your model is infeasible, ...

### LocalSolver sponsors ROADEF 2016 // 03 Feb 2016

LocalSolver 6.0 will be unveiled at ROADEF 2016, the annual congress of the French Operations Research Society, in Compiègne, 10-12th February 2016.

### LocalSolver sponsors ORBEL // 25 Jan 2016

LocalSolver is glad to sponsor ORBEL30, the 30th annual conference of Belgian Operationnal Research Society at UCL-CORE, January 28-29, 2016.

## 2015

### FICO Kaggle Challenge: Santa's Stolen Sleigh // 10 Dec 2015

The analytics company FICO has launched an optimization challenge on Kaggle: Santa's Stolen Sleigh. Julien Darlay, from LocalSolver R&D, proposes a simple optimization approach based on LocalSolver to solve this problem nearly optimally.

### LocalSolver at PGMO DAYS 2015 // 25 Sep 2015

LocalSolver will be at PGMO DAYS 2015. Discover how LocalSolver solves a real-life network optimization problem with 14,000 nodes and 180,000 edges in minutes.

### LocalSolver sponsors OR2015 in Vienna // 16 Jul 2015

LocalSolver sponsors OR2015 in Vienna. Come on our booth to meet the us and discover the big novelties released in LocalSolver 5.5 version!

### LocalSolver 5.5 is released // 11 Jul 2015

Have a look to this new version which offers new modeling features, as well as performance improvements for a bunch of hard problems.

### Welcome to our new clients // 03 Jul 2015

Several organizations have newly chosen LocalSolver to solve their most challenging optimization problems. Discover the corporations and institutions who trust us.

### LocalSolver sponsors EURO 2015 // 30 Jun 2015

LocalSolver sponsors the biggest OR event in Europe: EURO 2015. Come on our booth to meet the us and discover the big novelties coming in LocalSolver 5.5 version!

### LocalSolver at MIC 2015 // 15 Apr 2015

Julien Darlay will give a plenary talk at 11th Metaheuristics International Conference (MIC 2015) in Agadir, Morocco, from the 7 to 10th June 2015.

### Applications of Optimization 2015 // 31 Mar 2015

Frédéric Gardi will give a talk at the Applications of Optimization 2015 workshop organized by the Danish Operations Research Society (DORS).

### New release: LocalSolver 5.0 // 19 Jan 2015

LocalSolver 5.0 is out. Have a look to this new version which offers new modeling features, as well as performance improvements for a bunch of hard problems.

### Je suis Charlie // 11 Jan 2015

We are shocked and depressed by the terrible events that occurred in recent days in France. We have a thought for the victims and their families. #JeSuisCharlie

## 2014

### Welcome to our new clients // 20 Dec 2014

Several organizations have newly chosen LocalSolver to solve their most challenging optimization problems. Discover the corporations and institutions who trust us.

### LocalSolver hires: welcome to Clément! // 10 Nov 2014

LocalSolver hires: our team is pleased to welcome Clément Pajean, graduated from ENSTA ParisTech, one of the French "Grandes Ecoles".

### Plugging LocalSolver to the R language // 12 Aug 2014

Our Polish partner and reseller WLOG Solutions has developed the localsolver package for the R language.

### New release: LocalSolver 4.5 // 21 Jul 2014

We invite all our users to install LocalSolver 4.5. This new version offers new modeling features, as well as performance and numerical precision improvements.

### LocalSolver sponsors OR 2014 // 25 Jun 2014

LocalSolver sponsors OR 2014 in Aachen in Germany, from 2 to 5th September 2014. Come to our booth to discover LocalSolver and meet the team!

### LocalSolver at EUROPT 2014 // 07 May 2014

LocalSolver will be presented at the 12th EUROPT Workshop on Advances in Continuous Optimization, July 10-12 2014, in Perpignan, France.

### LocalSolver welcomes new clients // 23 Apr 2014

Several organizations have recently chosen LocalSolver as premier mathematical optimization solver: discover them!

### LocalSolver at SMAI-MODE 2014 // 30 Mar 2014

The team was invited to present LocalSolver at the 2014 workshop on Mathematics for Optimization and Decision (MODE), part of the French Society for Applied and Industrial Mathematics (SMAI), March 26-28th 2014 in Rennes, France.

### LocalSolver sponsors INFORMS 2014 // 14 Mar 2014

The LocalSolver team will have a booth and talk at INFORMS 2014 in Boston, Massachusetts. Come to meet us.

### LocalSolver at Paris Machine Learning Meetup // 12 Mar 2014

LocalSolver team was recently invited to the Paris Machine Learning Meetup organized by Igor Caron, to talk about large-scale optimization related to machine learning.

### Thierry Benoist's Habilitation // 06 Mar 2014

Thierry Benoist, member of the LocalSolver team, will defend his Habilitation Thesis on March 11th 2014 at Ecole des Mines de Nantes (France).

### LocalSolver sponsors JFPC-JIAF 2014 // 01 Mar 2014

LocalSolver sponsors the French Meeting on Constraint Programming and Articficial Intelligence, from 11th to 13th June 2014 in Angers, France.

### LocalSolver at ROADEF 2014 // 27 Jan 2014

LocalSolver will be at ROADEF 2014, the annual congress of the French Operations Research Society, in Bordeaux from 26th to 28th February. Come to meet the team!

### LocalSolver at Workshop ORO 2013 // 03 Jan 2014

Frédéric Gardi was invited as plenary speaker to the ORO Workshop in Nantes. He spoke about his research line on "how industrializing local search-based OR software?" which leads to the genesis of LocalSolver.

## 2013

### Merry Christmas: LocalSolver 4.0 is released! // 25 Dec 2013

We wish a Merry Christmas to all our clients and users: LocalSolver 4.0 is out! This new version allows to tackle large-scale mixed-variable non-convex optimization problems.

### Frédéric Gardi's Habilitation // 25 Nov 2013

Frédéric Gardi, member of the LocalSolver team, has defended his Habilitation Thesis on November 25th 2013 at Université Pierre et Marie Curie (Paris 6, Jussieu).

### Innovation 24, the parent company of LocalSolver // 17 Oct 2013

Discover Innovation 24, the parent company of LocalSolver, also offering expert services in business analytics and operations research.

### LocalSolver wins on some of the hardest MIPLIB instances // 15 Oct 2013

LocalSolver wins against both Gurobi and IBM ILOG Cplex on some of the hardest MIPLIB instances. Have a look!

### LocalSolver wins against MILP, MIQP, and CP solvers on QAPLIB // 01 Oct 2013

While MILP, MIQP or CP solvers are out of scope, LocalSolver reaches state-of-the-art results within 5 minutes on Quadratic Assignment Problem.

### Welcome to our new clients // 24 Sep 2013

We welcome our new clients: Hitachi, MédiaTransports (Publicis), NIES, Nanjin University.

### LocalSolver tutorial in IFORS Newsletter // 23 Sep 2013

IFORS is the International Federation of Operational Research Societies. A tutorial on LocalSolver appears in the last IFORS Newsletter.

### Welcome to our new partners // 19 Sep 2013

We are glad to welcome new LocalSolver partners.

### LocalSolver at the Summer School "Francesco Turco" 2013 // 10 Sep 2013

Our Italian partner LAC is sponsoring of Summer School "Francesco Turco" 2013. LocalSolver will be presented during the event.

### LocalSolver at OR55 in Exeter (UK) // 13 Aug 2013

LocalSolver is sponsoring OR55 in Exeter (UK), 3-5th September 2013. Come to our booth to meet the team!

### LocalSolver at OR 2013 in Rotterdam // 30 Jul 2013

LocalSolver is sponsoring OR 2013 in Rotterdam, 3-6th September 2013. Come to our booth to meet the team!

### LocalSolver 3.1 is out // 28 Jun 2013

LocalSolver 3.1 is now available. Enjoy it!

### LocalSolver at EURO-INFORMS 2013 // 15 Jun 2013

LocalSolver sponsors EURO-INFORMS 2013 in Rome. Don't miss the presentations made by the team!

### Speed dating with LocalSolver // 06 Jun 2013

A nice post about LocalSolver by the OR blogger Marc-André Carle.

### LocalSolver at ECCO 2013 // 30 Apr 2013

Don't miss the presentation of LocalSolver at ECCO 2013 in Paris.

### Welcome to our new clients // 02 Apr 2013

We welcome our new clients: Air Liquide, Armée de Terre, Fujitsu.

### LocalSolver at ROADEF 2013 // 18 Feb 2013

Retrieve all presentations about LocalSolver given at ROADEF 2013.

## 2012

### LocalSolver 3.0 is out // 03 Dec 2012

Want better solutions faster? Download LocalSolver 3.0 now!

### Customers & Partners // 14 Nov 2012

Welcome to our new customers & partners!

### LocalSolver in Japanese // 08 Oct 2012

LocalSolver now speaks Japanese thanks to our partner MSI.

### Logistics & Automation Consulting chooses LocalSolver // 24 Sep 2012

The Italian company Logistics & Automation Consulting (LAC) chooses LocalSolver as mathematical programming partner.

### LocalSolver now in OR education // 10 Sep 2012

LocalSolver appears as complement of classical MIP and CP solvers in OR courses in French universities and high schools.

### LocalSolver at ISMP 2012 // 15 Aug 2012

LocalSolver was at ISMP 2012, the world congress in mathematical programming, held in Berlin. Here are the (provocative!) slides.

### Customers & Partners // 02 Aug 2012

Welcome to our new customers & partners!

### New release: LocalSolver 2.1 // 06 Jul 2012

LocalSolver 2.1 was released the 6th July 2012. All users of LocalSolver 2.0 can take advantage of this new version for free.

### LocalSolver at EURO 2012 // 27 Jun 2012

LocalSolver is a sponsor of EURO 2012 in Vilnius (8-11 July). Come on exhibition booth #20 to discover LocalSolver and the team!

### Last results on Google ROADEF Challenge // 12 Jun 2012

We have submitted a LocalSolver-based solution for the final round of Google ROADEF Challenge. Here are given our results.

### LocalSolver in Optimization Days 2012 // 04 May 2012

LocalSolver was presented in Optimization Days 2012 in Montreal. You can download the slides of the presentation.

### Frédéric Gardi wins the 2012 Robert Faure Prize // 16 Apr 2012

This prize is awarded every 3 years by the French OR society to a worthy young researcher. This is the first time it has been awarded to an engineer working in industry and not to an academic.

### LocalSolver at ROADEF 2012 // 08 Apr 2012

LocalSolver sponsorizes ROADEF 2012 congress. LocalSolver 2.0 will be presented in industrial semi-plenary session. Come to discover it!

### LocalSolver available on Mac // 26 Mar 2012

Good news for Apple fans: LocalSolver is now available on Mac.

### Official launch of LocalSolver 2.0 at Bouygues Headquarters // 11 Mar 2012

LocalSolver team invites you to the official launch of the commercial version of its new-generation solver: Tuesday March 13 2012.

### LocalSolver tackles B instances on Google ROADEF Challenge // 24 Feb 2012

LocalSolver is able to solve some of the ultra-large instances from set B. Here are given some results.

### LocalSolver succeeds on Google ROADEF Challenge // 08 Feb 2012

Ranked 25th among 82 teams from 33 countries, LocalSolver is the sole math programming solver qualified for the final round.

### LocalSolver at Aussois 2012 // 09 Jan 2012

LocalSolver was recently presented at 16th Aussois Combinatorial Optimization Workshop.

## 2011

### LocalSolver in 4OR journal // 01 Sep 2011

The first paper on LocalSolver has been published in 4OR, a Quarterly Journal of Operations Research published by Springer.