The purpose of this assignment is to learn to
You will generate a visualization that looks like the figure above.
Highlight the shortest path between two actors in a Movie Actor graph.
getBaconNumber
that keeps track of parent information. Here is the algorithm:BFS(G=(V,E), root)
forall v in V
mark[v] = false;
mark[root] = true;
queue.push(root);
while (! queue.empty() )
v = queue.pop();
for (u in neighboor(v))
if (mark[u] == false)
mark[u] = true;
parent[u] = v;
HashMap
or C++'s std::unordered_map
.ArrayDeque
or C++'s std::queue
.GraphAdjListSimple documentation
ElementVisualizer documentation
std::unordered_map documentation
ElementVisualizer documentation