Class: SimpleGraph<Location>

graphs.SimpleGraph

Type parameters

Name
Location

Implements

Constructors

constructor

new SimpleGraph<Location>(edges?): SimpleGraph<Location>

Type parameters

Name
Location

Parameters

Name Type
edges Map<Location, Location[]>

Returns

SimpleGraph<Location>

Properties

edges

Private edges: Map<Location, Location[]>

Methods

addEdge

addEdge(origin, dest): void

Parameters

Name Type
origin Location
dest Location

Returns

void


addEdges

addEdges(origin, dests): void

Parameters

Name Type
origin Location
dests Location[]

Returns

void


addTwoWayEdge

addTwoWayEdge(origin, dest): void

Parameters

Name Type
origin Location
dest Location

Returns

void


neighbors

neighbors(id): undefined | Location[]

Returns the set of direct connections reachable from a location.

Parameters

Name Type Description
id Location The location to check for connections from

Returns

undefined | Location[]

Implementation of

Graph.neighbors