Even Number Of Hops
You have an unweighted undirected graph of 200,000 accounts and 800,000 follow relationships. For a pair (s, t) you need the shortest walk from s to t that uses an even number of edges. Repeating a vertex is allowed. Plain BFS reports 7 edges, which is odd, so it is not an answer to this question.
What do you run BFS on instead?
Sign in to answer questions and track your progress
Sign In