GithubHelp home page GithubHelp logo

kiwicom / travelling-salesman Goto Github PK

View Code? Open in Web Editor NEW
15.0 8.0 12.0 208.04 MB

Rules for Kiwi.com travelling salesman competition

Home Page: https://travellingsalesman.cz

Python 87.56% C++ 12.44%
flight scoring evaluation competition competitive-programming

travelling-salesman's Introduction

Rules:

  • Find the Hamiltonian cycle in time dependent flight graph
  • You are given:
    • m flights flying between n cities
    • n days to visit n cities
    • Start/end airport (round trip)
  • Being at day i in city x means you can catch all the flights on day i+1 from city x
  • All flights are immediate, they take no time.
  • On each day you have to board exactly 1 flight.
  • On some days, there might not be a flight between some cities.
  • We guarantee, that at least one Hamiltonian cycle in any given graph, exists.

Evaluation

  • You have 30 seconds for each dataset to produce valid output. After this period we kill your program if it hadn't already finished and process what your program outputted up to this point. Invalid output will result in 0 points but killing your program as such doesn't affect awarded points as long as you manage to produce valid result. Detailed description of our scoring system can be found in scoring README.
  • Evaluation data will be sampled the same way as the training real data - we will use real world prices of flights.

Program:

  • Executable in /app/run
  • Input will be STDIN, output will be STDOUT.

Input, STDIN

<City to start from>  # always a single IATA code
<FROM> <TO> <DateOfDeparture> <PRICE>
<FROM> <TO> <DateOfDeparture> <PRICE>
...

Some remarks about input:

  • <FROM>, <TO> - IATA codes - 3 English alphabet uppercase letters A-Z.
  • <PRICE> will be positive integer that fits into uint16_t - 16 bit unsigned integer (0 < <PRICE> <= 65535). (No prefixes, no hexa, nothing. Just number. :-])
  • Input data will be ordered lexicographically (FROM, TO, DateOfDeparture), with FROM/TO ordering to be also lexicographical. If this seems to be confusing, just look at the output of data_generator.py.

e.g.:

NAP
NAP BRQ 0 10
FCO BRQ 0 641
BRQ FCO 1 40
BRQ NAP 1 510
FCO NAP 2 3

Output, STDOUT

This will be strictly validated for syntax, and against input.

Format

  • We expect n+1 lines.
  • First line will be total price.
  • Second to last(n+1) line will contain flights in the same format as the input.

e.g.:

53
NAP BRQ 0 10
BRQ FCO 1 40
FCO NAP 2 3

travelling-salesman's People

Contributors

jendaplhak avatar marostkacik avatar xerus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

travelling-salesman's Issues

Add uncompressed versions of data

The .zip versions of data are harder to use. As GIT does compression by itself, I see no reason why not replace them with uncompressed .txt?

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.