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

Ants Versus Dijkstra: Which One Finds the Bus Route?Ants Versus Dijkstra: Which One Finds the Bus Route?

A comparison of two routing methods shows that speed and memory pull in different directions.

  • Conference
  • Publications

Written by

  • SRShirasaka RenIT & Infrastructure · Student Member

In this article

  1. 01How the comparison worked
  2. 02What they found

Finding a bus route sounds like a solved problem. You know where you are, you know where you want to go, and you want the shortest combination of lines in between. It turns out there is more than one way to compute that answer.

Dijkstra is the classic choice. It expands outward from the starting point until it reaches the destination. Routing software has relied on it for decades because it is reliable and its results are predictable.

Ant colony optimization takes a different path entirely. It borrows the behaviour of real ants, which find short routes by laying down pheromone trails that later ants follow. In software, simulated ants explore a graph repeatedly and the best paths accumulate artificial pheromone.

Ant colony optimization borrows the trail behaviour of real ants. Photo: Rajani Gairshail, CC0, via Wikimedia Commons.
Fig. 01Ant colony optimization borrows the trail behaviour of real ants. Photo: Rajani Gairshail, CC0, via Wikimedia Commons.

01/02

How the comparison worked

The study asked a specific question: can ant colony optimization produce recommendations as good as Dijkstra when both get the same resources? The team ran Dijkstra first to establish the best route, then let the ant based method try to match it.

  • Both algorithms were evaluated on computation time and memory consumption, including the memory allocated at the start and at the end of each run.
  • Measurements were repeated rather than taken once, so that results could not be distorted by a single unlucky run of the JavaScript garbage collector.
Real ants converge on short paths over time. Photo: DEEPAN RAJA .M, CC BY-SA 4.0, via Wikimedia Commons.
Fig. 02Real ants converge on short paths over time. Photo: DEEPAN RAJA .M, CC BY-SA 4.0, via Wikimedia Commons.

02/02

What they found

The ant based approach was more efficient in execution time and in the number of pathways it traversed. The trade-off was memory. The findings suggest that ant colony optimization may need a larger memory budget to deliver the outcomes the researchers were looking for.

A network graph of the kind both algorithms search. Image: Logan Essex, CC BY-SA 4.0, via Wikimedia Commons.
Fig. 03A network graph of the kind both algorithms search. Image: Logan Essex, CC BY-SA 4.0, via Wikimedia Commons.

The honest reading is that neither method wins outright. Dijkstra gives a predictable answer with a modest footprint. Ant colony optimization can move faster across a large search space, but it asks for more memory to get there. Which one fits depends on the device and the shape of the network.

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 articleWebGL Is Fine Until the Model Gets Big(Keep scrolling)(Read it next)(Loading)