Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. FUNCTION ComputeSTCutVertices(G, s, t)
- 2. // Computes all (s, t) cut vertices in DAG G
- 3. TopologicalOrder = TopologicalSort(G)
- 4. CutVertices = empty list
- 5.
- 6. For each vertex v in TopologicalOrder:
- 7. isSTCutVertex = true
- 8. For each edge u -> w in G:
- 9. If u is strictly earlier and w is strictly later than v in ordering
- 10. isSTCutVertex = false
- 11. Break inner loop
- 12. If isSTCutVertex:
- 13. CutVertices.append(v)
- 14.
- 15. Return CutVertices
- 16. END FUNCTION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement