private void Traverse(IGraphNode node) { visitedIDs.Add(node.Id); foreach (var neighbor in node.FindNeighbors()) { var edge = new GraphEdge(node, neighbor); if (!edges.Contains(edge)) { edges.Add(edge); Traverse(neighbor); } } }