Please enable JavaScript.
Coggle requires JavaScript to display documents.
Pathfinding Algorithm - Coggle Diagram
Pathfinding Algorithm
Graph representation
Nodes
Edges
Weighted edges
Adjacency list or matrix
Initialization
Assign infinity distance
Set source node distance 0
Priority queue for node selection
Data structures for tracking distance
Steps
Select the node with the smallest distance
Relax neighboring nodes
Update distances if shorter paths found
Continue until all nodes visited
Priority Queue
Data structure for efficient node selection
Min-heap or min-priority queue
operations insert extract minimum
key comparison for efficient updates
Relaxation
compare current distance with tentative distance
Update distance if shorter path found
Update parent node or previous node
Propagate changes through the graph
Termination
All nodes visited or destination reached
shortest path distance determined
Path reconstruction from destination to source
Optimal path extracted from parent pointers
Dijkstra's algorithm
single source shortest path
weighted directed graphs
optimizing path lengths
Applications
Routing in networks
Gps navigation
Shortest path analysis