Algorithmes de graphes
Parcourez les algorithmes de graphes étape par étape et observez comment ils traversent les nœuds et les arêtes.
Comparaison de Algorithmes de graphes
| Algorithme | Temps | Espace | Résout | Pondéré |
|---|---|---|---|---|
| Depth-First Search | O(V + E) | O(V) | Traversal | No |
| Breadth-First Search | O(V + E) | O(V) | Traversal / shortest path | No |
| Topological Sort | O(V + E) | O(V) | Ordering (DAG) | No |
| Dijkstra's Algorithm | O((V + E) log V) | O(V) | Shortest path | Yes (non-negative) |
| Bellman-Ford Algorithm | O(V · E) | O(V) | Shortest path | Yes (± weights) |
| Kruskal's Algorithm | O(E log E) | O(V) | Minimum spanning tree | Yes |
| Prim's Algorithm | O(E log V) | O(V) | Minimum spanning tree | Yes |