public static IEnumerable <TVertex> GetNeighbours <TVertex, TEdge>(
     this IBidirectionalGraph <TVertex, TEdge> graph, TVertex vertex, EdgeDirection edgeDirection)
     where TEdge : IEdge <TVertex>
 {
     return(edgeDirection == EdgeDirection.In
         ? graph.GetInNeighbours(vertex)
         : graph.GetOutNeighbours(vertex));
 }
 public static IEnumerable <TVertex> GetAllNeighbours <TVertex, TEdge>(
     this IBidirectionalGraph <TVertex, TEdge> graph, TVertex vertex)
     where TEdge : IEdge <TVertex>
 {
     return(graph.GetInNeighbours(vertex).Union(graph.GetOutNeighbours(vertex)));
 }