GithubHelp home page GithubHelp logo

kiwits's Introduction

Kiwi Travelling Salesman competition submission

This was our shot at the travelling salesman competition hosted by Kiwi.com.

Outline

We were given a dataset containing data about flights that go from a airport 1 to airport 2 at a given day for a given price and a starting airport. We were supposed to find a full cycle that has one flight every day and visits all the airports in the dataset.

We tried various methods of loading and storing of the data as well as many methods to search for the cycle. In the end, we went for dictionary dataset and a simple backtracking algorithm, which proved the most efficient.

Python turned out not to be the greatest tool to do that, because we failed to even load the biggest dataset in the timeout of 30s. However, we did provide a working solution that was able to compete on the other, smaller datasets.

Out of the circa 300 teams enlisted, about 70 provided a working solution and we placed somewhere around 30th place.

Running

You'll find the 'run' bash wrapper and a simple test script in the 'app' folder.

To run the code, you will need

  • python 3, numpy and Cython, both of which can be installed with pip3 (might require sudo).
  • compile Cython components: go to src/datasets and src/searchers and run build.sh in both places.

Benchmarking and some other scripts may require the kiwi repo to be cloned and files unpacked into kiwisources/ (git clone https://github.com/kiwicom/travelling-salesman.git), which is kinda big and you don't need it for the app/test.py testscript.

Exploration

I have added readmes to most of the subfolders to give a basic outline of what is where.

If you want to only check what we actually used in the end, look into:

  • app/
  • run_async.py
  • src/datasets/CDictDataset.pyx
  • src/datasets/CFlight.pyx
  • src/searchers/CAsyncBackTracker.pyx

kiwits's People

Contributors

janjsmejkal avatar majermartin avatar petrbarborka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.