MGMLaboratory
Back

Menu

01Home
02About Us
03Projects
04Publications
05Member
06Articles
07Contact

Let's Talk

Open in Mail app

Socials

Malang (ID) --:--Privacy PolicyTerms of Service

November 24, 20232 min read

What Two Routing Algorithms Teach Us About Transit AppsWhat Two Routing Algorithms Teach Us About Transit Apps

Choosing a routing method is a trade off between time, memory, and the phones your users actually carry.

  • Conference
  • Publications

Written by

  • SRShirasaka RenIT & Infrastructure · Student Member

In this article

  1. 01Pick your metric before your algorithm

Choosing an algorithm for a product is rarely about which one is mathematically better. It is about which cost you are willing to pay, on the hardware your users actually carry.

A 2023 study compared two ways of recommending public transit routes: the long established Dijkstra algorithm and ant colony optimization, which mimics how ants find short paths. The goal was not to crown a winner, but to see whether the newer method could match the older one under the same conditions.

01/01

Pick your metric before your algorithm

The team tracked computation time and memory consumption, including how much memory each method held at the start and at the end of a run. Those two numbers are usually what decides whether a feature feels smooth on a mid range phone.

Graph analysis software visualising a large network. Image: SlvrKy, CC BY-SA 4.0, via Wikimedia Commons.
Fig. 01Graph analysis software visualising a large network. Image: SlvrKy, CC BY-SA 4.0, via Wikimedia Commons.

Three habits from this study are worth copying into your own benchmarks.

  • Establish ground truth first. The team ran Dijkstra to define the best route, then asked the competing method to match it. Without that reference, a faster result proves nothing.
  • Measure repeatedly. A single reading hides variance, while repeated runs expose the real spread of results.
  • Record the trade off, not just the win. Ant colony optimization came out ahead on execution time and on the number of pathways traversed, but the findings suggest it needs a larger memory budget.
Transit systems can be modelled as layered networks. Image: Martin Grandjean, CC BY-SA 4.0, via Wikimedia Commons.
Fig. 02Transit systems can be modelled as layered networks. Image: Martin Grandjean, CC BY-SA 4.0, via Wikimedia Commons.

The measurement discipline here is easy to underestimate. Running the same test many times protects against one off artifacts, and the researchers call out the garbage collector specifically. In a managed runtime, memory behaviour during a single run can be an accident of timing rather than a property of the algorithm.

Public minivans at a terminal in Malang. Photo: Mujiono Ma'ruf, CC BY-SA 4.0, via Wikimedia Commons.
Fig. 03Public minivans at a terminal in Malang. Photo: Mujiono Ma'ruf, CC BY-SA 4.0, via Wikimedia Commons.

For teams building transit features, the practical advice is to define what you are optimising for before writing the code. If memory is scarce, the classic algorithm is a safe default. If you are searching a very large network and can afford the footprint, the ant based approach deserves a test on your own data.

Source

  1. Abdul Jabbar and Aryo Pinandito (2023). Recommending Public Transit Route: Ant-Colony Optimization or Dijkstra? 2023 International Conference on Modeling and E-Information Research, Artificial Learning and Digital Applications.

    DOI10.1109/ICMERALDA60125.2023.10458207 (opens in a new tab)

Next articleAnts Versus Dijkstra: Which One Finds the Bus Route?(Keep scrolling)(Read it next)(Loading)