Real-time visual of search paths and cost heuristics using A* and Dijkstra algorithms.
Overview
This project showcases core AI pathfinding algorithms implemented in C#, including Dijkstra's Algorithm, A*. The system visualizes node states, path costs, and algorithm behavior in real-time.
Core Concepts
- Grid-based movement with walkable and blocked nodes
- Heuristic-based cost calculation (Manhattan distance)
- Open/closed set management and node state transitions
- Visual debugging of paths, visited nodes, and frontier expansion
YouTube Demo
A* Algorithm (C#)
A* combines Dijkstra’s guaranteed optimal pathfinding with a heuristic function to prioritize promising nodes. It evaluates each step using f(n) = g(n) + h(n)
, where g
is the cost from start and h
is the estimated cost to the goal.
Loading...
Dijkstra's Algorithm (C#)
Dijkstra’s algorithm calculates the shortest path from a starting node to all other nodes, using a uniform cost function. It explores exhaustively and guarantees the optimal path, but lacks the heuristic acceleration A* provides.
Loading...
GridTile/Node (C#)
Defines the core structure and logic for individual nodes within the pathfinding grid. Each tile tracks its grid position, movement cost metrics (g, h, f), and its visual state for real-time debugging. It supports dynamic terrain types (e.g., slow tiles, obstacles) with cost modifiers and color-coded rendering. The class also includes utility methods for resetting, updating costs, and calculating Manhattan distance heuristics used in A*.
Loading...