This enables linear-time computation of shortest distances on DAGs that also allows for negative weights.