Study

All-Pairs Shortest Path (APSP)

Flashcards
1 / 0
algorithms graph theory shortest path dynamic programming complexity analysis data structures python java
💬 Click on the content to Ask AI
Explore More
🔥 floyd-warshall algorithm Floyd–Warshall is a dynamic-programming algorithm that implements the APSP task by computing the full pairwise shortest-path distance (and optionally predecessor) matrix, handling negative edges and detecting negative cycles, especially suitable for dense graphs.
🔥 dijkstra algorithm APSP defines the multi-source shortest-path objective and constraints; it specifies contexts (e.g., nonnegative edges, sparse graphs) where Dijkstra serves as the single-source subroutine within APSP solutions like repeated Dijkstra and Johnson’s algorithm, thereby enabling its correct application.
🔥 johnson algorithm Johnson's algorithm is a specific method for solving APSP on sparse graphs with some negative edges; it relies on the APSP problem definition and expected outputs (all-pairs distance/predecessor matrices) to structure its reweighting plus repeated Dijkstra approach.
⚡️ single-source shortest path
⚡️ single-pair shortest path