Added implementation for shortest path in DAG