Search Results for

    Show / Hide Table of Contents

    Interface IGraph

    A graph data structure, directed or undirected.

    Namespace: MoreStructures.Graphs
    Assembly: MoreStructures.dll
    Syntax
    public interface IGraph
    Remarks

    DEFINITION
    A graph is a data structure composed of two types of objects: vertices and edges.
    Both vertices and edges can carry labels, weights, costs, or any other piece of information, specific to the scenario in which they are used.
    More precisely, a graph is conceptually defined as a couple of two collections:
    - a collection of vertices,
    - and a collection of edges, connecting such vertices, directionally or undirectionally.
    The actual underlying representation of a graph instance depends on the specific IGraph used.

    Methods

    | Improve this Doc View Source

    GetAdjacentVerticesAndEdges(Int32, Boolean)

    Returns the vertices of the graph which are neighbor of the start vertex, each vertex together with its incoming or outgoing edge, linking the vertex to the start vertex.

    Declaration
    IEnumerable<IGraph.Adjacency> GetAdjacentVerticesAndEdges(int start, bool takeIntoAccountEdgeDirection)
    Parameters
    Type Name Description
    System.Int32 start

    The id of the vertex, to look for neighbors of.

    System.Boolean takeIntoAccountEdgeDirection

    Whether to consider the direction of edges, when looking for neighbors.

    Returns
    Type Description
    IEnumerable<IGraph.Adjacency>

    A sequence of IGraph.Adjacency instances, containing the id of the neighboring vertex V found, and the edge which connects the start vertex to V, or viceversa. The order is undefined, and depends on the implementation.

    | Improve this Doc View Source

    GetAllEdges()

    Returns all the edges of this graph.

    Declaration
    IEnumerable<(int edgeStart, int edgeEnd)> GetAllEdges()
    Returns
    Type Description
    IEnumerable<System.ValueTuple<System.Int32, System.Int32>>

    A sequence of couples (sourceVertex, targetVertex), each identifying an edge of the graph.

    | Improve this Doc View Source

    GetNumberOfVertices()

    Returns the total number of vertices of the graph.

    Declaration
    int GetNumberOfVertices()
    Returns
    Type Description
    System.Int32

    A non-negative integer.

    | Improve this Doc View Source

    Reverse()

    Builds the reverse graph, i.e. a graph with the same set of vertices and reversed edges: for each edge (u, v) of the graph G, there is one edge (v, u) in the reverse graph G^-1.

    Declaration
    IGraph Reverse()
    Returns
    Type Description
    IGraph

    A new instance of IGraph, representing the reverse graph.

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX