Course week 11

Self-study

The topics for this week are (i) Weighted graphs and their implmentation in C++, (ii) Dijkstra’s algorithm, (iii) The A-star algorithm and (iv) The efficiencies of graph search algorithms

The following links will take you to the video-lectures and the accompanying slides:

Weighted graphs and their implmentation in C++

Dijkstra’s algorithm

There is a mistake in section 4 of the slides used in the video. This mistake is corrected in the slides that you can download.

The efficiency of three graph algorithms

Weighted graphs

A weighted graph differs from a normal graph in that …

Suppose in C++ for each node \(x\) in a connected weighted graph we use the following vector to contain the adjacent nodes to \(x\) and the weight of each edge.

std::vector< std:pair<Node*,Weight>> to_neighbours;

Suppose we are accessing vector to_neighbours for node \(N\). What does a contain after the following line is executed?

auto a = to_neighbours[0].second;

Dijkstra’s algorithm

Dijkstra’s algorithm is most similar to which of the following algorithms?
Suppose Dijkstra’s algorithm uses node \(s\) as the starting node. When, in Dijkstra’s algorithm, a node \(v\) having priority \(v.prior\) is extracted from the priority queue, what is the significance of \(v.prior\)?
Suppose Dijkstra’s algorithm uses node \(s\) as the starting node. What is the purpose of the Relax procedure?
In Dijkstra’s algorithm many quantities or variables are associated with each node \(x\). Which of the following will not change during the execution of Dijkstra’s algorithm?

The A-star algorithm

Suppose we have a directed weighted graph and a starting node \(s\). Which of the following describes one way in which the A-star algorithm and Dijkstra’s algorithm differ?
In the A-star algorithm something is computed that is not computed in Dijkstra’s algorithm. What is it?
What is a central question, related to this course, whose answer can be found in this week’s videos?
Of the following topics, which do you think deserves further discussion/explanation during the weekly consultation session?
Were there any parts of the video lectures that were particularly difficult? Particularly interesting? Something about which you wish to learn more?

Extra links on the topic:

A site where you can visualize the progress of different graph search algorithms

Week11 - Glossary

Submit weekly exercises

Questions to be submitted this week