Find first K shortest distances between two nodes in graph
Given a weighted directed graph consisting of N nodes and M edges, the task is to find the first K shortest distances between two nodes A and B. (Assuming there are k distinct routes between nodes A and B). Example: Input: A=1 , B=4, K=3, Below is the graph :- Output: 4 4 7 Explanation : The shortest… Read More »