Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Graph

Examples

const { Graph } = require('dsajs');
// or  
import { Graph } from 'dsajs';

let ds = new Graph();

Hierarchy

  • Graph

Index

Constructors

constructor

Properties

Private _

_: Map<any, any>

Methods

addEdge

  • addEdge(from: any, to: any): void
  • Add an edge between from and to

    Parameters

    • from: any

      need to match the type of vertex added

    • to: any

      need to match the type of vertex added

    Returns void

addVertex

  • addVertex(v: any): void

deleteVertex

  • deleteVertex(v: any): boolean
  • Delete a vertex if available

    Parameters

    • v: any

    Returns boolean

    if vertex is deleted successfully

getVertex

hasPath

  • hasPath(from: any, to: any): boolean
  • Check if there exists a path between from and to

    Parameters

    • from: any
    • to: any

    Returns boolean

removeEdge

  • removeEdge(from: any, to: any): void
  • Remove an edge between from and to

    Parameters

    • from: any

      need to match the type of vertex added

    • to: any

      need to match the type of vertex added

    Returns void

Generated using TypeDoc