walkccc / CLRS

📚 Solutions to Introduction to Algorithms Third Edition
https://walkccc.me/CLRS
MIT License
4.65k stars 1.26k forks source link

Update 24.1.md #412

Closed NicolasRoelandt closed 2 years ago

NicolasRoelandt commented 3 years ago

The current solution suggests to start from the marked vertices and go up the predecessor tree to mark all these nodes with -infinity. But these nodes are not necessarily reachable from these mark nodes, i.e. the direction in which we traverse is wrong. We should simply run a DFS on the marked nodes to see all the ones that are reachable from them.

walkccc commented 2 years ago

Thank you!