Algorithmic Pathfinding Simulation

Analysis of Graph Traversal Efficiency in Weighted Networks

Network Grid Visualization

Grid: 40x40 Nodes
âš™ī¸
Running Statistical Batch (N=30)...
Key: Dark = Wall | White = Road

Algorithm Definitions

Dijkstra's Algorithm Optimal

The standard for finding the shortest path. It expands in all directions uniformly based on accumulated cost.

function Dijkstra(start, goal):
  pq.push(start, 0)
  while pq not empty:
    current = pq.pop()
    if current == goal: return path
    for neighbor in current.neighbors:
      new_cost = cost[current] + weight(edge)
      if new_cost < cost[neighbor]:
        cost[neighbor] = new_cost
        pq.push(neighbor, new_cost)
A* (A-Star) Search Balanced

Optimizes Dijkstra by using a Heuristic (h) to estimate distance to the goal. Prioritizes nodes closer to the destination.

function A_Star(start, goal):
  pq.push(start, 0)
  while pq not empty:
    current = pq.pop()
    if current == goal: return path
    for neighbor in neighbors:
      new_cost = cost[current] + weight
      prio = new_cost + heuristic(neighbor, goal)
      if new_cost < cost[neighbor]:
        pq.push(neighbor, prio)
Bidirectional A* Fastest

Runs two searches simultaneously: one forward from Start, one backward from Goal. They meet in the middle, reducing search space.

Greedy Best-First Sub-Optimal

Selects the next node purely based on geometric distance to the goal, ignoring traffic weights. Fast but often inefficient.

function Greedy(start, goal):
  pq.push(start, heuristic(start, goal))
  while pq not empty:
    current = pq.pop() 
    if current == goal: return path
Breadth-First Search Unweighted

Explores layer by layer. Finds the path with fewer steps, but ignores traffic weights (Cost).

Control Panel

â„šī¸ Step 1: Click on the grid to set START.

Single Run Metrics

Algorithm Time (ms) Cost
- No Data -

Statistical Benchmark

Executes 30 random scenarios to calculate RMSE against the optimal path.

Algo Avg Time Avg Cost RMSE
- Waiting for Batch -