WE OFFER A FREE CONSULTATION
Add file
development
5 MIN READ

Routing
issues
in Uber-like
apps

How to solve
them?

August 19, 2019
Working on the technical side of a new product, developers rarely see the direct impact of their efforts on the startup's success. This article shows how Uber-like app development goes hand-in-hand with company growth. You will read about the challenges and solutions for building on-demand multiple delivery apps.

The rise of on-demand services

The total revenue of the on-demand delivery industry will reach $335 billion by the year 2025.

With the high popularity of supply services, on-demand delivery startups pop-up every day. They belong to various industries. Food and gifts delivery, on-demand medical and beauty services, transportation and taxi companies. All these businesses are based on the concept of on-demand solutions.

Economics uberization is a new trend in the startup and business field.

Uber-like apps provide high-quality services saving customers' time and money. Platform-based companies (Airbnb, Grab, Lyft) caused a revolution in their business domains.
Unlike traditional businesses, they offer peer-to-peer transactions and direct connections for a
win-win collaboration.
The desire to attract customers makes more and more founders build their Uber-like apps. I worked on such a project as a Senior software developer, and I'll share my experience.

You will read about

  • the structure of on-demand multiple delivery apps
  • Uber-like software development technologies
  • pitfalls of routing algorithm optimization

3 categories of on-demand delivery apps

Let's start the discussion by identifying 3 types of Uber-like startups.

B2B
Business to business on-demand apps solve global transportation problems. They connect enterprises and support great transactions.

B2C
Business to consumer tools make the biggest part of these apps. They are popular e-commerce services or tools for connecting provider and customers.

C2C
The last app category serves as a platform for users' communication. They receive or offer goods/services independently. For example, BlaBlaCar.
All the mentioned business models have specific pros and cons. I'd like to talk about the second variant, which means business to consumer relations.

This model provides several benefits:

  • freedom (drivers feel free to take delivery orders or refuse)
  • speed (it's easier for a company to find couriers in a specific area)
  • convenience (service provider works with many freelance couriers)
  • quality (ratings ensure high standards of client service)
  • effectiveness (company brand helps to promote many couriers)
So, B2C Uber-like app can be quite profitable and deliver almost any type of goods. But the technical side of its development includes several challenges. Let's talk about them.

Briefly review of Uber-like app architecture

Could you recall the on-demand apps working principle? A customer lets the company know he/she needs service. So, the app asks where the user is. Then, the system finds a nearby driver and shows the customer the car will arrive in minutes. In the end, the app asks for users feedback.

What technologies does the delivery app rely on?

To unlock the power of an on-demand mobile app, keep in mind its main parts:
    • server
    • payments
    • mapping
    As for the server part, the most popular programming languages are Node.js, Java, C++, C#, Python. There are many different adapters for payments implementation (Stripe, Braintree, Paytm, PayPal mobile SDK). Other required features are push notifications, user profile, SMS, etc.

    What does prevent Uber-like apps from achieving success on the Apple Store and Google Play? Let's consider 2 main challenges.

    Challenge #1: Vehicle Routing Problem

    An unoptimized routing algorithm causes the gap between multiple delivery apps and the top-ranking. To find the optimal trip for a driver, the system needs to solve a great mathematical challenge.

    That means:
      • receiving of all parameters (travel, time, traffic) for all points of all deliveries
      • permutation of all combinations in the resulting chart, taking into account optimizations and constraints to eliminate unnecessary options
      Program implementation from the geometric (simplified) point of view leads to losing sight of crucial parameters.
      Program implementation from the geometric (simplified) point of view leads to losing sight of crucial parameters. That causes slaw deliveries, poor quality of services and customers' disappointment. Thus, an optimized routing program is essential for the effectiveness of business processes and positive brand reputation.

      Routing module development from scratch using Node.JS isn't a good idea since this task requires high-performed (e.g. parallel) calculations. As for me, Google OR-tools is the best way to solve the routing problem. The library is widely used for solving combinatorics problems. So, it's a powerful tool for multiple delivery routing optimizations.

        Reasons to use Google OR-tools

        • Open Source project: free license and regular updates
        • Orientation: part of the library is directly intended to solve transport problems
        • Flexibility: it's possible to set different constraints and modify the technology
        • Authoritative source: solution by Google, which is compatible with many other technologies
        • Stability and productivity: the algorithms are pre-optimized for specific multi-threaded tasks.
        • Infrastructure control: the final solution is a simple program that can be deployed in any convenient form (starting from a manual installation, ending with Docker) in any cloud service. That means maximum control and minimal infrastructure costs
        OR-Tools development
        So, FreshCode team prefers Google OR-tools as a basis for the algorithm for finding the optimal route. Look on the example below.
          Uber-like app
          The picture demonstrates a simple route choosing task.

            Challenge #2: Location Problem

            In addition to routing optimization, the system requires a distance matrix. It's necessary to obtain data on traffic between the delivery points.

            The possible software implementations are
              • Google Distance Matrix API
              • Mapbox Matrix API
              • OpenStreetMap
              I recommend the last option as the most affordable solution. OpenStreetMap and its API provide the required functionality within a tight budget.

                Reasons to use OpenStreetMap

                • Open Source project: free license, regular updates
                • Stability: 15-year project contains a large number of tools and third-party services for expanding the functionality
                • Extensive support: over 1 million users contributing to the development
                • Flexibility: the opportunity to customize tools and additional services
                • Low cost: affordable solution in terms of workloads compared to the Google Distance Matrix API and Mapbox Matrix API. The only costs are OpenStreetMap deployment
                OpenStreetMap benefits

                Can professional software development make business grow?

                Google-OR tools and OpenStreetMap are very effective for route search algorithm optimization. The routing module is capable to select the best possible transport options and provides comfortable working conditions for couriers. It has a huge impact on the commercial success of on-demand multiple delivery companies.

                Business profits from routing optimization
                  • Commercial benefits right after system update
                  • Delivery speed greatly increases
                  • Drivers enjoy convenient and effective routing
                  • Uber-like app stands out in the competition
                  Future project development may include certain module improvements. For example, separation of individual clusters, regions, and areas. As the users can be located in specific territories, the drivers won't get notifications about orders at a distance of over 50 km from their current position.
                    Takeaways

                    1. An Uber-like app is a perspective and relevant business idea.
                    2. The app's tech architecture consists of server, payments and routing.
                    3. Google-OR tools and OpenStreetMap are the best tech solutions.
                    4. Routing optimization brings obvious business benefits.
                    On-demand delivery companies are increasingly empowering local companies. They help to reach more local customers and become independent from global logistics leaders.

                    Are you ready to build your on-demand delivery app? Book a free consultation by FreshCode team and make your idea happen.

                    Don't miss future tech insights on our blog, I'll write about Google-OR tools and OpenStreetMap in detail. Stay in touch!
                      1
                      2
                      3
                      4
                      5
                      Tech and business insights
                      Get valuable content once a week!
                      THE MOST popular POSTS
                      Show more