Pergunta de entrevista da empresa LiveRamp

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