Constructors
constructor
- new Vertex(id: string, value: T): Vertex
-
Parameters
Properties
Private _edges
_edges
: Map<string, Edge>
id
id: string
value
value: T
Accessors
size
-
Returns number
Methods
addEdge
- addEdge(edge: Edge): boolean
-
Parameters
Returns boolean
edges
-
Returns Edge[]
forEachEdge
- forEachEdge(callback: (edge: Edge, to: string) => void): void
-
Parameters
-
callback: (edge: Edge, to: string) => void
-
- (edge: Edge, to: string): void
Returns void
getEdge
- getEdge(to: string): Edge | undefined
-
Parameters
Returns Edge | undefined
hasEdge
- hasEdge(to: string): boolean
-
Parameters
Returns boolean
Private lock
-
Returns void
removeEdge
- removeEdge(to: string): boolean
-
Parameters
Returns boolean
Represents a node in a graph. It consists of a unique id, a value and a collection of edges connecting it to other vertices.