LiveRamp interview question

How would I implement the kevin bacon number problem using DFS instead of BFS?