Given a directed graph and some of its nodes, how to prune the nodes that cannot reach any of the given nodes. (I term it leaf components, which I am not sure is a correct term)
Are there any known algorithms solving this efficiently?
It would be perfect if you could point out some Java Open source code for it.
Thanks.