Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IntAdjacencyGraph<VertexIndex, EdgeProps, Props>

Represent a graph using vertex adjacency list.

Edges of the i-th vertex are stored in the arrays a and b for indices in the range [offset[i], offset[i+1]).

Edge properties are indexed same as in the arrays a and b.

Type parameters

Hierarchy

  • IntAdjacencyGraph

Index

Properties

a: ArrayLike<VertexIndex>
b: ArrayLike<VertexIndex>
edgeCount: number
edgeProps: Readonly<EdgeProps>
offset: ArrayLike<number>
props?: Props
vertexCount: number

Methods

  • getDirectedEdgeIndex(i: VertexIndex, j: VertexIndex): number
  • Get the edge index between i-th and j-th vertex. -1 if the edge does not exist.

    getEdgeIndex(i, j) !== getEdgeIndex(j, i)

    Parameters

    • i: VertexIndex
    • j: VertexIndex

    Returns number

  • getEdgeIndex(i: VertexIndex, j: VertexIndex): number
  • Get the edge index between i-th and j-th vertex. -1 if the edge does not exist.

    Because the a and b arrays contains each edge twice, this always returns the smaller of the indices.

    getEdgeIndex(i, j) === getEdgeIndex(j, i)

    Parameters

    • i: VertexIndex
    • j: VertexIndex

    Returns number

  • getVertexEdgeCount(i: VertexIndex): number
  • Parameters

    • i: VertexIndex

    Returns number

Generated using TypeDoc