Git Product home page Git Product logo

bescala-hakking's Introduction

BeScala hAkking Event

Use case

In a wholesale market for geometric objects, a customer can publish a demand containing one or more (generally a couple of thousands) geometric object specification.

A geometric object consist of:

  • A shape - Square, Rectangle, Circle, Triangle and Ellipse
  • A color - Red, Orange, Yellow, Green, Blue, White and Black
  • A material - Glass, Wood, Metal, Paper, Plastic and Ceramic
  • An area - area is expressed on cm2. It can go from from 1cm2 up to 100cm2

Suppliers can respond with offers. Each offer has one or more (generally a couple of thousands) quotes for geometric objects. A quote consist of a GeometricObject and a price (in euro).

Since it's a wholesale market, the buyer must buy all objects in an offer. As such, the program must find which offers combination delivers the best price and the least reminder.

For example:

Demand

Circle  |   Blue  |   Glass   | 10   cm2
Circle  |   Blue  |   Glass   | 10   cm2
Circle  |   Blue  |   Metal   | 20   cm2
Circle  |   Blue  |   Ceramic | 11   cm2

Offer 1

Circle  |   Blue  |   Glass   | 10   cm2  | 8     euro
Circle  |   Blue  |   Glass   | 10   cm2  | 8     euro
Circle  |   Blue  |   Paper   | 12   cm2  | 0.30  euro
Circle  |   Blue  |   Metal   | 20   cm2  | 8     euro

Offer 2

Circle  |   Blue  |   Glass   | 10   cm2  | 2     euro
Circle  |   Blue  |   Ceramic | 11   cm2  | 4     euro

Offer 3

Circle  |   Blue  |   Glass   | 10   cm2  | 2     euro
Circle  |   Blue  |   Metal   | 20   cm2  | 2     euro
Circle  |   Blue  |   Glass   | 10   cm2  | 3     euro
Circle  |   Blue  |   Metal   | 60   cm2  | 15    euro
Circle  |   Blue  |   Metal   | 70   cm2  | 20    euro       

Offer 4

Circle  |   Blue  |   Glass   | 10   cm2  | 2     euro
Circle  |   Blue  |   Glass   | 10   cm2  | 2     euro
Circle  |   Blue  |   Paper   | 12   cm2  | 0.30  euro
Circle  |   Blue  |   Metal   | 20   cm2  | 8     euro

The demand can be fulfilled if we buy combine (offer 1 + offer 2) or (offer 2 + offer 3) or (offer 2 + offer 4).

The combination offer 2 + offer 4 delivers the best price and smallest reminder.

The code to search for the best combination is provided. The goal of this hacking session is not to find the algorithm that will give us the best combination, but how can we improve the performance by spliting this task over different Actors.

For the above example it's prettry easy and straitforward. No optimization is required for such a small amount of geometric objects. But does it will scale? What about a demand of 2000 geometric objects and 5 offers with quotes going from 3000 to 10000? What about a demand of 20000 and offers up to 100000?

The first target will be to send each combination to a different actor and collecting the result. The second target will be to, inside a combination, split it further to reduce the search space.

bescala-hakking's People

Contributors

vansweej avatar

Watchers

James Cloos avatar Diallo Abdoulaye 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.