All one hundred eight build stories
SAIFULLAH AHAD / BUILD STORY
A courier route planner for a day of many stops: the method, and the app
A courier route planner is only as good as the list it starts from, so this page first shows how to put a day of stops in order by hand, then how I built Mthenga to do the same work on a phone.
Put a delivery day in order by hand
Take a courier with a crate of parcels and a hub to come back to. Before any app, the order of the day comes from six small decisions. The U.S. fuel economy site run for the Department of Energy and the EPA says it plainly in its Planning and Combining Trips page: "Combining errands into one trip saves you time and money." The same page adds: "It can also reduce the distance you travel."
- Write every stop in one list. Customer, address, the parcel, and the cash to collect if there is any. A stop that lives only in your head is the one you will ride past.
- Fix the start and the finish. Most couriers begin and end at the same hub. Write it at the top and the bottom of the list so the way home is counted.
- Write each time limit next to its stop. An office that takes parcels until one o'clock, a shop that closes at six, a customer who is only home after five. These stops decide the shape of the day, so they go in first.
- Group the rest by area. Finish one neighborhood before you start the next, and try not to cross the same main road more than you must. A stop that is far from the others gets visited once, on the way to somewhere, not as a trip of its own.
- Check the limited stops against the clock. Add the riding time between stops and a few minutes at every door, then see whether you reach each closing time. If one does not fit, decide now, not at the door: call the customer or move that parcel to tomorrow.
- Leave room to change. Someone will not answer and new parcels will arrive. Keep the list where you can edit it, and redo the order from where you are standing, not from the hub.
Putting stops in the shortest order is a famous problem with a name. The National Institute of Standards and Technology lists it as traveling salesman and describes it less formally as: "find a path for a salesman to visit every listed city at the lowest total cost". By hand that is fine for a handful of stops. With dozens of stops and time limits on top, the counting gets long, which is where a phone helps.
How Mthenga does the same steps
I built Mthenga: Delivery Routes for couriers, drivers and anyone who visits many places in one day. As a delivery route planner app it follows the list above: you put the stops in, it puts them in an order on real roads, and it tells you which stops it could not fit.
The Today screen after a route was optimized, with sample stops in Dhaka.
- Step 1, the list. "Add stops" has three tabs: "Manual", "Paste list" and "Scan label". The paste screen says: "Paste parcel addresses or delivery sheets. Supports RouteXL, JSON, labeled text, and one address per line." A day can hold up to 150 stops.
- Step 3, the time limits. A time written like 09:00 >> 12:00 on a pasted stop is read as its window and shows on the stop as "Time window". The manual form has no field for it.
- Where each stop is. The app labels how it found a place: "Previously delivered location", "City area search" or "Pinned by you". It will not plan until it has one: "Confirm the exact delivery location before planning a route."
- Step 4, the order. Tap "Optimize route". The app works out the order on the phone using the city map, and shows the stops, kilometers and minutes for the day. You choose the vehicle on the "Day and settings" screen: Motorbike, Car, Bicycle or On foot.
- Step 5, the check. A stop that cannot fit is listed under "Stops that could not fit", with its name and a reason, such as a closing time it would miss.
- Step 6, the changes. On "Next stop" you see the customer, the address and the window, with "Open dial screen" and "Open navigation" to hand the call or the directions to other apps. Then mark "Delivered", "Failed" or "Later". Tap "Optimize route" again after a change to plan again.
Which cities, and the map download
Planning on real roads needs a city map on the phone. Mthenga downloads one per city and vehicle, and the store listing names five cities:
- Dhaka
- Chattogram
- Karachi
- Lahore
- Delhi (Greater NCR)
Open "Maps" to see "Installed maps" and "Available city maps". Each has a "Download" button and a size; on the test phone the Dhaka motorbike map showed 31 MB. Once a map is installed, planning runs on the phone without a signal. Before that, the app says "No city map is installed" and "A verified map is needed to plan routes on roads." Map data comes from OpenStreetMap contributors, and the app warns when a map is old: "This map may be out of date. Check for a yearly update."
The Maps screen: one map installed, the others waiting to be downloaded.
The Add stops screen on its "Manual" tab, with fields for the cash to collect.
Honest limits and what was not checked
- Without a downloaded city map it cannot plan on roads, and it has maps for the five cities above only.
- It does not promise arrival times. The minutes it shows are a planning estimate from the road map, with no live traffic, so leave room in the day.
- A stop that does not fit is shown, never quietly dropped, but you decide what to do about it.
- It is not a delivery route map app. The route view draws your stops and a line between them on a plain background, not streets. For turn by turn directions, "Open navigation" hands the stop to another app.
- Saved days stay on the phone and are not backed up. The app says: "Removing the app or losing the phone loses those records."
- The release build was walked on one phone with six sample stops, in light and dark themes. A full day with dozens of stops was not tried on a phone, and no working courier has tested it for me.