Skip to Content

Optimized Routing & Resource Allocation – Helping the Socially Responsible India Run Better

What started as a challenge of a Hackathon to solve a real world problem in helping an NGO to prepare optimized routes covering the selected schools in the shortest route with maximum utilization of resources, has taken shape to solve problems in many domains. This journey has taken us paths that we’d have hardly trod upon, owing to implicit complexity of the problem and being exposed to an entire open stack development.


Many NGOs in India conduct programs to help students in schools from rural areas by creating exposure to outside world affairs and to create awareness on various topics. These NGOs require a route plan to cover different schools across the year with two important criteria, minimize distance covered and maximize the number of students benefited from the program. The status quo being that the routes are prepared manually, resulting in

  1. Poor efficiency both in terms of distance covered and maximum occupancy,
  2. Routes being fixed well ahead not accounting for dropouts on the field.


The schools marked on the map that acts as inputs (latitude, longitude) pairs to the algorithm. The algorithm processes the routes generation in two steps,

  1. First, straight line distances between destinations are mathematically calculated using Haversine’s Formula and the destinations are clustered. The step greatly improves the performance in that the reliance on road distances that is fetched from external APIs available are reduced from large number of individual destination to a small number of cluster.
  2. Then, the groups will start acting as destination for the next step in the algorithm where an approximation over the Dijkstra’s algorithm introducing relative offset to get a better trade of on resource optimization.

For the routes generated, the entities which in our case will be the students from a given school, are allocated maximizing the utilization of resources and picking the right sized vehicle available which can be configured.


    Fig. 1 Steps in Preparing the Route for the given school destinations


One of the freedom (ironically, a restriction in our case) that we had in this development was to develop entirely on open stack so that NGOs doesn’t have to bear any extra cost on the software, except for the infrastructure. We’ve used OpenUI5 for the frontend, Node.js environment for the application layer and MySQL for the database. Now divulging into the details of the architecture.


Fig. 2 Architecture – Interacting Entities

Node.js Runtime

The choice of node.js server runtime is because of the network heavy nature of the application, as the application depends on the Maps API (external HTTP outbound calls) for finding the distance and direction between two hop points on a given route.

The web framework uses Express, which is a Node.js web application server framework, designed for building single-page, multi-page, and hybrid web applications. It is the de facto standard server framework for node.js, using Express we host a static file server, through which we can access and test our application on the browser. Major part of the node runtime is the route optimizer & resources allocator engine, where the proposed algorithm executes and provides the necessary routes using google APSs to suggest routes, metrics and paths. Finally mySQL Community Server Edition is used, which is a free to use backend solution.

UI Technology

OpenUI5 is an Open Source JavaScript UI library, maintained by SAP and available under the Apache 2.0 license. Since all us had already worked on UI5, this fit best to start the development at an accelerated pace.

Features of the Application

  • The application enables the user to geo-tag schools in rural area, as these schools would not be marked by default on the map.


Fig 3. Selecting Schools from Map for Route Preparation

  • The algorithm optimizes the resource utilization based on different types of resource (transportation vehicle), that can be configured.
  • The application uses an indigenous algorithm (extension of Djkistra’s Shortest Path) that will generate optimized routes maximizing resource utilization and reducing the distance covered.
  • The application also allows user to change routes manually thus giving flexibility for ad hoc changes in the route generated.
  • The application will gives the metrics such as distance covered, cost incurred for each route and the overall route generated


Fig 3. Route Prepared with metrics shown on the right

Usage in other Domains

Looking at problems of same nature in different domains, the solution can also be applied to other domains with minimal level of customization. Below are few examples explained where the solution can be used.

Retail Distribution – The solution optimizes the routes generated for the delivery people based on the commodities to be delivered and also the capacity of commodities the truck/container can accommodate

NGOs & Schools – This solution helps the NGO/schools to pick up the students from various destinations and assemble them at a common place, by preparing the routes and allocating buses/vans as required for each route

Cab pickup and drops for organizations – This solution helps organizations with optimized routes for commuting their employees


Though this was more on the architecture, design aspects, and the solution itself, look out for the next blog on more dev friendly how-to on building a simple application applying the architecture described in this blog. See you soon…


Syed Aleemuddin Noor

Thamizharasan Mohan

Be the first to leave a comment
You must be Logged on to comment or reply to a post.