Code Monkey home page Code Monkey logo

diversity.hack's Introduction

We wanted to graduate from MIPT younger (Мы хотели закончить физтех молодыми)

Short solution descriptions:

First one — simple_solution() doesn't look on the price and consistently chooses for each courier the closest free order, calculates the company profit by sum over all couriers(order_price - courier_salary). Solution works fast.

Second one — courier_solution() works in similar way, but chooses for each courier not the closest order but the most profitable. Courier work until he can benefit the company. Works fast, result: 263240.

Third one — order_solution() for each order chooses the courier that can provide the company with the best profit. These profits make up the sum. By the way, the order of orders(haha) is defined like the earlier the order is available, the earlier we take this order into consideration. Works fast, result: 258676.

For hard_courier_solution() function best_courier() was added, it builds for each courier the chain of actions for the whole day and computes the profit, chooses from them the best one and adds this chain to events list, courier and orders of this chain becomes unavailable. Works for about 40 minutes, result: 266572.

Fifth one — hard_hard_curier_solution() chooses the best courier based not on the whole chain but only the 3 first actions of the day and adds to event only one action(of course, updates the courier position). Works for about a half of the day, result: 270566.

How to run solutions:

Compile with make

Makefile has parameters:

Main:

DF - name of file with data (e.g. - contest) OF - name of solution file (e.g. - hard_hard_curier)

Additional

DATA_DIRECTORY - path to directory with data OUTPUT_DIRECTIORY - path to answers directory

DATA_PREFICS - prefix of data file SOLUTION_PREFICS - prefix of answer files PYTHON - python interpreter

Run:

By default we run hard_hard_couriers, on dataset contest.

We can run hard_couriers on dataset simple:

make DF=simple OF=hard_couriers

So the output will be recalculated. To run check.py on the output:

make check DF=simple OF=hard_couriers

diversity.hack's People

Contributors

rvg77 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.