Options
All
  • Public
  • Public/Protected
  • All
Menu

This implementation uses an adjacency-lists representation. All operations take constant time (in the worst case) except iterating over vertices and over the vertices adjacent from a given vertex, which takes time proportional to the number of such vertices.

For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

Type parameters

  • V

Hierarchy

  • AdjacencyListDigraph

Implements

Index

Constructors

constructor

Properties

Private adjacencyList

adjacencyList: StringMap<object> = new StringMap<ListNode<V>>()

Private edgesAmount

edgesAmount: number = 0

Private indegrees

indegrees: StringMap<number> = new StringMap<number>()

Private verticesAmount

verticesAmount: number = 0

Methods

addEdge

addVertex

adjacent

asEdgesCollection

asVerticesCollection

e

  • e(): number

indegree

  • indegree(v: Vertex<V>): number

outdegree

  • outdegree(v: Vertex<V>): number

reverse

toString

  • toString(): string

v

  • v(): number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc