Show / Hide Table of Contents

    Class DiGraph<T>

    A directed graph implementation. IEnumerable enumerates all vertices.

    Inheritance
    Object
    DiGraph<T>
    Implements
    IEnumerable<T>
    IEnumerable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Advanced.Algorithms.DataStructures.Graph.AdjacencyList
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class DiGraph<T> : IEnumerable<T>, IEnumerable
    Type Parameters
    Name Description
    T

    Constructors

    DiGraph()

    Declaration
    public DiGraph()

    Properties

    ReferenceVertex

    Return a reference vertex to start traversing Vertices Time complexity: O(1).

    Declaration
    public DiGraphVertex<T> ReferenceVertex { get; }
    Property Value
    Type Description
    DiGraphVertex<T>

    VerticesCount

    Declaration
    public int VerticesCount { get; }
    Property Value
    Type Description
    Int32

    Methods

    AddEdge(T, T)

    Add an edge from source to destination vertex. Time complexity: O(1).

    Declaration
    public void AddEdge(T source, T dest)
    Parameters
    Type Name Description
    T source
    T dest

    AddVertex(T)

    Add a new vertex to this graph. Time complexity: O(1).

    Declaration
    public DiGraphVertex<T> AddVertex(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    DiGraphVertex<T>

    FindVertex(T)

    Returns the vertex object with given value. Time complexity: O(1).

    Declaration
    public DiGraphVertex<T> FindVertex(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    DiGraphVertex<T>

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    HasEdge(T, T)

    Do we have an edge between the given source and destination? Time complexity: O(1).

    Declaration
    public bool HasEdge(T source, T dest)
    Parameters
    Type Name Description
    T source
    T dest
    Returns
    Type Description
    Boolean

    InEdges(T)

    Declaration
    public IEnumerable<T> InEdges(T vertex)
    Parameters
    Type Name Description
    T vertex
    Returns
    Type Description
    IEnumerable<T>

    OutEdges(T)

    Declaration
    public IEnumerable<T> OutEdges(T vertex)
    Parameters
    Type Name Description
    T vertex
    Returns
    Type Description
    IEnumerable<T>

    RemoveEdge(T, T)

    Remove an existing edge between source and destination. Time complexity: O(1).

    Declaration
    public void RemoveEdge(T source, T dest)
    Parameters
    Type Name Description
    T source
    T dest

    RemoveVertex(T)

    Remove an existing vertex frm graph. Time complexity: O(V) where V is the total number of vertices in this graph.

    Declaration
    public void RemoveVertex(T value)
    Parameters
    Type Name Description
    T value

    Explicit Interface Implementations

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    IEnumerator

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top Generated by DocFX