![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FoQlTP%2FbtrEInWrnfD%2FQoP6BejA0h8GMvjV92Ot51%2Fimg.png)
Shortest Path Algorithms Algorithm Complexity Handle Negative weight? Properties Dijkstra O((n+m) log n) O(n^2) No - Good for dense graph - Adjacency matrix is better Bellman-Ford O(nm) Yes - Detect negative weight cycle - Adjacency edge list is better DAG-based O(n+m) Yes - Graph must be acyclic - Adjacency edge list is better Floyd- Warshall O(n^3) Yes (No negative-weight cycle) - Good for den..