private IEnumerable <TEdge> GetEdges(TVertex vertex) { IEnumerable <TEdge> inEdges; if (VisitedGraph.TryGetInEdges(vertex, out inEdges)) { foreach (TEdge edge in inEdges) { yield return(edge); } } IEnumerable <TEdge> outEdges; if (VisitedGraph.TryGetOutEdges(vertex, out outEdges)) { foreach (TEdge edge in outEdges) { yield return(edge); } } }