January 2018
Intermediate to advanced
332 pages
7h 36m
English
Okay, it's not what it sounds like. We are not heading down a romantic path where we ask each other the difficult question. We are, however, talking about a simple graph, for example, a family tree (yes, trees are forms of the graph). In this example, we will use BFS to determine the shortest path between two nodes, which can then establish the relationship between those two nodes.
Let's first set up our test data so that we have the input graph ready:

You can note from the preceding diagram that we have a small family in which nodes A, E, and F are siblings. A is married to B with nodes C and D as their ...
Read now
Unlock full access