Route Interview Question

Write a graph traversal/aggregation algorithm