graph-toolkit
    Preparing search index...

    Interface Graph

    Immutable graph. Undirected edges are stored as two arcs in Csr.

    interface Graph {
        csr: Csr;
        degree: (id: VertexId) => number;
        directed: boolean;
        edgeCount: number;
        edges: () => readonly Edge[];
        edgesBetween: (source: VertexId, target: VertexId) => readonly Edge[];
        hasEdge: (source: VertexId, target: VertexId) => boolean;
        hasVertex: (id: VertexId) => boolean;
        indexOf: (id: VertexId) => number;
        neighbors: (id: VertexId) => readonly Edge[];
        vertexAt: (index: number) => VertexId;
        vertexAttributes: (id: VertexId) => Attributes;
        vertexCount: number;
        vertices: () => readonly VertexId[];
    }

    Implemented by

    Index
    csr: Csr
    degree: (id: VertexId) => number

    Out-degree (loops count once).

    directed: boolean
    edgeCount: number

    Number of logical edges (an undirected edge counts once).

    edges: () => readonly Edge[]
    edgesBetween: (source: VertexId, target: VertexId) => readonly Edge[]

    Every edge from source to target, parallel ones included.

    hasEdge: (source: VertexId, target: VertexId) => boolean

    $O(\text{out-degree})$.

    hasVertex: (id: VertexId) => boolean
    indexOf: (id: VertexId) => number
    neighbors: (id: VertexId) => readonly Edge[]

    Outgoing edges of id.

    vertexAt: (index: number) => VertexId
    vertexAttributes: (id: VertexId) => Attributes

    Attributes of a vertex (an empty object when it has none).

    vertexCount: number
    vertices: () => readonly VertexId[]