Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Is a shortest path between two vertices in a weighted graph unique if the weights of edges are distinct?

Short Answer

Expert verified

The shortest path between two vertices need not be unique.

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Given data

The graph is given as,

02

Concept used of Dijkstra’s algorithm 

Dijkstra's algorithm allows us to find the shortest path between any two vertices of a graph.

03

Find the least path

Consider the graph shown below with vertices

\(A,B\) and \(C\) with weight \(AB = 1\), weight \({\rm{AC}} = 2\) and weight \(BC = 3\)

In this case the weights are distinct but there are two shortest paths from \(B\) to \(C\): the direct path \(B,C\) and the path through \({\rm{A:B,A,C}}\) both having the same length 3 .

This example shows that the shortest path between vertices need not be unique (even) if the weights are distinct.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free