1. Calculate in-degree for all vertices
2. Add vertices with in-degree 0 to queue
3. While queue is not empty:
4. Dequeue vertex and add to result
5. For each neighbor of vertex:
6. Decrease neighbor's in-degree
7. If in-degree becomes 0, enqueue
8. Check if all vertices processed