Sailing Home problem
"As the captain of a sailboat, you have been given the task of sailing to Faraway Island for some nutmeg and then sailing safely home. You reach for your trusted chart to plot the route. The chart, as shown below, shows your current location (point A), the location of Faraway Island (point B), and indications of how the wind is blowing. You have a motor on board, but you'd really like to take advantage of the wind wherever possible, even if that means a somewhat circuitous journey."
And so opens the annual MATLAB Online Programming contest held by the MathWorks. The Sailing Home competition (Fig. 1) was won by Andre Ricardo Fioravanti, PhD Candidate, Institut National de Recherche en Informatique et en Automatique, with his entry, Lost Sailor Final5.
What caught my eye was how this competition was run. It was much different than the typical tech competition where each participant has a single, final submission. Instead, multiple entries are submitted by individuals. An entry cannot be changed once submitted but subsequent entries can be based on anyone's prior work. A new entry based on an existing entry will be better only if its score is better. There was a limited time that entries could be submitted and reviewed.
The contest is clearly designed to highlight Matlab. Entries could not utilize Java, ActiveX and a host of other Matlab features but the core computational capabilities where there. Essentially the contest was designed to provide a level playing field.
I had a chance to talk with Andre about the competition and how it was different from other events.
Wong: Tell us a little about the MATLAB Online Programming contest you just won. What was the challenge this time?
Fioravanti: The motivation of the problem was about a sailor who needed to go to some island and come back home in a sailboat, using the wind as much as possible and the motor as few as possible. The wind chart was given to plan your route, and you were scored accordingly to how far you passed through that island, how far home you finished and how much fuel you used in order to change the natural motion provided by the winds. Time of execution of your program and complexity of the code were also taken into account.
Wong: How do you address the problem?
Fioravanti: Having background in dynamical systems, I modeled the dynamics, the control inputs and the cost of a solution in a pure mathematical way. Although this was quite straightforward, the problem itself was far from being a "standard" one, and it became soon clear that it was not the best approach. This was still in 'darkness' phase, which is the part when you cannot see the codes nor the score of the submissions. The second phase is called 'twilight', when we can see the scores but not the codes themselves. It was impressive to see the quality of the results that some people had already obtained with no feedback of their own score. At this point, you just wish to arrive to the 'daylight' phase, when all codes are finally opened. And to further see the spirit of cooperation of this competition, Nicholas Howe, the winner of both the darkness and twilight phases, posted a text explaining all the details of his best submission.
Wong: This competition is a bit different than most because cooperation and using other people’s solution is encouraged. What approach did you take?
Fioravanti: Getting into the daylight phase changes completely the game. Now you have some good code to use as a starting point and you have almost immediate feedback for all your ideas. Most of the time people are searching to tune all the open parameters, or merging in the same code different algorithms and trying to choose the best one to use for each particular set of entries. But eventually (and it is not rare) a new idea comes, gets a high score, and everything restarts in order to incorporate this new code and optimize all the parameters again. It is really dynamic.
Wong: Did your approach change throughout the competition?
Fioravanti: As you might have noticed, it is hard to claim 'property' of your ideas. Once you tested it, and it is successful, it will be reused, reshaped and optimized. So, close to the end game, you tend to keep your final ideas with you, and just test it in the final minutes. The problem is that most of the competitors are doing exactly the same thing, which makes it exciting and unpredictable.
Wong: What did you learn from this competition?
Fioravanti: As you have access to the code of plenty of people trying to solve the exact same problem, we are able see different implementations of the same idea, which can easily teach some new coding techniques. Even more important is to see how fast the score improves once the cooperation starts. This contest is unique in the sense of exploring this cooperation/competition contrast, and it might be interesting to see how well it can be applied in other scenarios.