Implement reverse dependency resolution algorithm.