Is the following statement valid?.

*Given a graph where all edges have positive weights, the shortest paths produced by Dijsktra and Bellman Ford algorithm may be different but path weight would always be same.*

**(A)** True

**(B)** False

**Answer:** **(A)** **Explanation:** Dijkstra and Bellman-Ford both work fine for a graph with all positive weights, but they are different algorithms and may pick different edges for shortest paths.

Quiz of this Question

## Recommended Posts:

- Algorithms | Graph Shortest Paths | Question 14
- Algorithms | Graph Shortest Paths | Question 2
- Algorithms | Graph Shortest Paths | Question 3
- Algorithms | Graph Shortest Paths | Question 4
- Algorithms | Graph Shortest Paths | Question 14
- Algorithms | Graph Shortest Paths | Question 7
- Algorithms | Graph Shortest Paths | Question 8
- Algorithms | Graph Shortest Paths | Question 9
- Algorithms | Graph Shortest Paths | Question 10
- Algorithms | Graph Shortest Paths | Question 11
- Algorithms | Graph Shortest Paths | Question 12
- Algorithms | Graph Shortest Paths | Question 13
- Algorithms | Graph Shortest Paths | Question 14
- Johnson’s algorithm for All-pairs shortest paths | Implementation
- Number of paths from source to destination in a directed acyclic graph
- Shortest path in a directed graph by Dijkstra’s algorithm
- Building an undirected graph and finding shortest path using Dictionaries in Python
- Shortest path in a complement graph
- Create a Graph by connecting divisors from N to M and find shortest path
- Algorithms | Graph Traversals | Question 1