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.
Define a weighted graph.
Think about if there's a cost to travel along the edges.
What is the purpose of Dijkstra's algorithm?
Recall which algorithm is best for non-negative weights.
What is a weighted graph?
Think about costs associated with travel.
Does Dijkstra’s algorithm work with negative weights?
Remember what we've discussed about algorithms.
Imagine you are the logistics manager of a company. You need to create a cost-effective route to deliver items to five locations using Dijkstra’s algorithm. Draw the graph and calculate the shortest path.
Start at one of the locations and continually update the cost to reach other locations.
Given a weighted graph with negative edge weights, demonstrate how the Bellman-Ford algorithm functions and computes shortest paths. Include a visual representation.
Remember, this algorithm involves systematically relaxing edges multiple times.
5 more questions in this section. Enroll free to practise them all.
Enroll free