retagged by
679 views
0 votes
0 votes
can anyone explain how dijkstras will behave as BFS whwn a graph is unweighted?

 

retagged by

2 Answers

0 votes
0 votes
In an unweighted graph,priority queue will behave like a simple queue (as all the connected edges is represented as 1) with FIFO policy.At first, the first frontier will be pushed into the queue & explored(nodes which are just a single edge away from the source node) and then the second frontier,and so on.This behavior resembles that of BFS.

Related questions

1 votes
1 votes
1 answer
2
Souvik33 asked Dec 19, 2022
675 views
If a -ve weight cycle is reachable from source, the Dijkstra's algorithm gets into an infinite loop TRUEFALSE