Options
All
  • Public
  • Public/Protected
  • All
Menu

The interface for the entry point of this library. The main method is addEdge, which checks whether the given edge can be added without adding a cycle, and if so, modifies the VertexData of the edge to reflect this fact. It must be called at least once for each edge that was added.

Type parameters

  • TVertex

Hierarchy

  • CycleDetector

Implemented by

Index

Methods

canAddEdge

  • canAddEdge(g: GraphAdapter<TVertex>, from: TVertex, to: TVertex): boolean
  • Checks whether adding the given edge creates a cycle. Must be called at least once for each edge that was added for the algorithm to work correctly. It the edge cannot be added, does not perform any modifications.

    Parameters

    • g: GraphAdapter<TVertex>

      The graph data structure to be used.

    • from: TVertex

      Source vertex of the edge.

    • to: TVertex

      Target vertex of the edge.

    Returns boolean

    true iff the specified edge can be added to the graph without introducing a cycle.

createVertexData

  • Creates the vertex data the algorithm needs. This needs to be called exactly once for each vertex of the graph and must be the data returned by GraphAdapter#getData.

    Parameters

    • g: GraphAdapter<TVertex>

      The graph data structure to be used.

    Returns VertexData

    The data to be set on the vertex.

getOrder

  • getOrder(g: GraphAdapter<TVertex>, vertex: TVertex): number
  • Returns the topological order of the vertex, if supported.

    Parameters

    • g: GraphAdapter<TVertex>

      The graph data structure to be used.

    • vertex: TVertex

      Vertex for which to determine its order.

    Returns number

    The topological order of the given vertex.

isReachable

  • isReachable(g: GraphAdapter<TVertex>, source: TVertex, target: TVertex): boolean
  • Checks whether the target vertex can be reached from the source vertex, possibly with some algorithm-specific optimizations.

    Parameters

    • g: GraphAdapter<TVertex>

      The graph data structure to be used.

    • source: TVertex

      Source vertex for the search.

    • target: TVertex

      Target vertex for the search.

    Returns boolean

    true iff the target vertex can be reached from the source vertex, ie. iff there is a path from source to target.

map

  • Type parameters

    • TClonedVertex

      Type of the cloned vertices.

    Returns CycleDetector<TClonedVertex>

    A independent copy of this detector for a possibly different type of vertex. Changes to the state of this detector do not affect the state of the cloned detector and vice-versa.

onVertexDeletion

  • onVertexDeletion(g: GraphAdapter<TVertex>, vertex: TVertex): void
  • Must be called when a vertex is deleted. The graph adapter must behave as if the vertex was not deleted just yet, ie. return the data for the vertex etc.

    Parameters

    • g: GraphAdapter<TVertex>

      The graph data structure to be used.

    • vertex: TVertex

      New vertex that is about to be added or was just deleted.

    Returns void

supportsOrder

  • supportsOrder(): boolean
  • Returns boolean

    true iff this algorithm supports querying a vertex's topological order.

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