samedi 24 février 2018

Micro-job platform - matching orders with nearest worker


I am currently planning to develop a micro-job platform to match maintenance workers (plumbers, electricians, carpenter, etc) with users in need through geolocation. Bookings can be made well in advance or last minute (minimum 1h before) at the same fare.

Now, I am struggling to find a suited matching algorithm to efficiently assign bookings to available workers. The matcher is basically a listener catching "NewBooking" events, which are fired on a regular basis until a worker is assigned to the specific booking. Workers can accept or decline the job and can choose working hours with a simple toggle button (when it's off they will not receive any request). On overall the order is assigned within a certain km range.

The first system I thought of is based on concentric zones, whose radius is incremented every time the event is fired (not indefinitely). All workers online within the area will be notified and the first to accept gets the job.

Pros:

  • more opportunities to match last minute bookings;

Cons:

  • workers may get a lot of notifications;
  • the backend processing several push & mail messages;

1st algorithm

A second solution is based on linear distance, assigning the work to the nearest available worker and, if (s)he does not accept it within a certain timeframe (like 30'), the algorithm goes to the next available person and so on.

Pros:

  • less processing power;
  • scalability with lots of workers and requests;

Cons:

  • less chances to match last minute orders;

2nd algorithm

Third alternative is to use the first approach sending orders in multiple batches according to feedback ratings; the first group to receive the notification is made out of those with 4+ stars, then 3+ avg. of votes and so on.

I was wondering if there is a best practice when it comes to this kind of matching algorithms since even taxi apps face these issues. Anyway, which approach would you suggest (If any), or do you have any proposal on possible improvements? Thank you

Aucun commentaire:

Enregistrer un commentaire