The condition that non parent neighbour has distance (neighbour) >= distance(current node) seems wrong.If it is correct can you explain why?
Code is wrong - The condition about non parent neighbour's distance
hey @Amritansh-A-2378926112184997 we are using BFS here so we will first check the neighbours of node with less dist from source, if we found any neighbour with dist<dist[curr node] then we have already checked this current node as a neighbour of the current neighbour so no need to check min of them in that case.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.