in Algorithms retagged by
186 views
0 votes
0 votes
Can shortest path contains positive weight cycle???Please explain with examples.
in Algorithms retagged by
186 views

1 Answer

0 votes
0 votes
Shortest path dont contain any "positive weight cycles". Let us see this with the help of an example

suppose the cost of A to B is 2;B to C is 5;and A to Cis:3; and this is the subgraph of a graph for which we have to calculate the shortest path. Now this cycle cant exist in the graph as we cant have all these 3 edges (u can check this by applying any shortest path algo).

Related questions

0 votes
0 votes
0 answers
1
Vaishnavi01 asked in Algorithms Nov 19, 2018
174 views
Vaishnavi01 asked in Algorithms Nov 19, 2018
174 views