Show / Hide Table of Contents

    Class WeightedDiGraph<T, TW>

    A weighted graph implementation. IEnumerable enumerates all vertices.

    Inheritance
    Object
    WeightedDiGraph<T, TW>
    Implements
    IGraph<T>
    IEnumerable<T>
    Namespace: Advanced.Algorithms.DataStructures.Graph.AdjacencyList
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class WeightedDiGraph<T, TW> : IDiGraph<T>, IGraph<T>, IEnumerable<T> where TW : IComparable
    Type Parameters
    Name Description
    T
    TW

    Constructors

    WeightedDiGraph()

    Declaration
    public WeightedDiGraph()

    Properties

    IsWeightedGraph

    Declaration
    public bool IsWeightedGraph { get; }
    Property Value
    Type Description
    Boolean

    VerticesAsEnumberable

    Declaration
    public IEnumerable<IGraphVertex<T>> VerticesAsEnumberable { get; }
    Property Value
    Type Description
    IEnumerable<IGraphVertex<T>>

    VerticesCount

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

    Methods

    AddEdge(T, T, TW)

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

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

    AddVertex(T)

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

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

    Clone()

    Clone this graph.

    Declaration
    public WeightedDiGraph<T, TW> Clone()
    Returns
    Type Description
    WeightedDiGraph<T, TW>

    ContainsVertex(T)

    Declaration
    public bool ContainsVertex(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    Boolean

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator

    GetVertex(T)

    Declaration
    public IDiGraphVertex<T> GetVertex(T key)
    Parameters
    Type Name Description
    T key
    Returns
    Type Description
    IDiGraphVertex<T>

    HasEdge(T, T)

    Do we have an edge between 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<Tuple<T, TW>> InEdges(T vertex)
    Parameters
    Type Name Description
    T vertex
    Returns
    Type Description
    IEnumerable<Tuple<T, TW>>

    OutEdges(T)

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

    RemoveEdge(T, T)

    Remove the given edge from this graph. Time complexity: O(1).

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

    RemoveVertex(T)

    Remove the given vertex. Time complexity: O(V) where V is the number of vertices.

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

    Implements

    IGraph<>
    IEnumerable<>
    Back to top Generated by DocFX