/// <inheritdoc />
        public bool TryGetInEdges(TVertex vertex, out IEnumerable <SReversedEdge <TVertex, TEdge> > edges)
        {
            if (OriginalGraph.TryGetOutEdges(vertex, out IEnumerable <TEdge> outEdges))
            {
                edges = EdgeExtensions.ReverseEdges <TVertex, TEdge>(outEdges);
                return(true);
            }

            edges = null;
            return(false);
        }
 /// <inheritdoc />
 public IEnumerable <SReversedEdge <TVertex, TEdge> > InEdges(TVertex vertex)
 {
     return(EdgeExtensions.ReverseEdges <TVertex, TEdge>(OriginalGraph.OutEdges(vertex)));
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UndirectedGraph{TVertex,TEdge}"/> class.
 /// </summary>
 /// <remarks>Gets the best edge equality comparer.</remarks>
 /// <param name="allowParallelEdges">Indicates if parallel edges are allowed.</param>
 public UndirectedGraph(bool allowParallelEdges)
     : this(allowParallelEdges, EdgeExtensions.GetUndirectedVertexEquality <TVertex, TEdge>())
 {
     AllowParallelEdges = allowParallelEdges;
 }