In a directed acyclic graph (DAG), which algorithm can be used to determine a linear ordering of vertices?
14 views
- Dijkstra’s Algorithm
- Kruskal’s Algorithm
- Topological Sorting (Correct Answer)
- Prim’s Algorithm
Explanation
Topological sorting provides a linear ordering of vertices in a DAG such that for every edge u → v, u appears before v. Dijkstra, Kruskal, and Prim are for shortest paths or MST, not topological order.