Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
The very basics
Infinite looping
Processing graphs with recursive CTEs
25. Graphs – real life example
Summary

Instruction

Very good! Since you already know the table, you can tackle this exercise.

Let's say we have a salesman who needs to travel between certain cities in the UK, as shown in the picture below.

recursion

There are 6 cities and multiple connections between them, some of which are shown in the picture. The salesman needs to travel from London, visiting each city in turn.

Exercise

Our salesman starts his journey in London and then wants to visit each city. In which direction should he go? In which city should he finish his journey? Let's help him by calculating the shortest path that will visit all cities. Run the template, look at the results, and don't worry about the details right now.