Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What defines a shortest path in a graph?
Think about the weights of the edges.
Can a shortest path have repeating vertices?
Consider the effect of looping back.
What is the maximum number of edges in a shortest path across n vertices?
Consider how many unique vertices could be traversed without revisiting.
True or False: A shortest path can revisit vertices if there's a negative edge.
Think about the impact of a loop on the path total.
Design a graph that contains a negative cycle. Explain how the Bellman-Ford algorithm might respond.
Make sure to set the edge weights purposely so that the total is negative when summed.
Given a set of edges, apply the Bellman-Ford algorithm to find the shortest path from the source vertex to all others and illustrate your steps.
Count iterations carefully! Remember, you will need n-1 runs through the edge list.
4 more questions in this section. Enroll free to practise them all.
Enroll free