Skip to content

Typed API (TypeDoc)


Typed API (TypeDoc) / IGraph

Interface: IGraph<T, V, E, Events> ​

Defined in: graph/src/graph.ts:47

Extends ​

Type Parameters ​

T ​

T

V ​

V extends IVertex<T>

E ​

E extends IEdge<T>

Events ​

Events extends GraphEvents<T>

Properties ​

adjacencyMatrix? ​

optional adjacencyMatrix: AdjacencyMatrix

Defined in: graph/src/graph.ts:91

Overrides ​

GraphProperties.adjacencyMatrix


connected? ​

optional connected: boolean

Defined in: graph/src/graph.ts:30

Inherited from ​

GraphProperties.connected


connectedComponentsCount? ​

optional connectedComponentsCount: number

Defined in: graph/src/graph.ts:31

Inherited from ​

GraphProperties.connectedComponentsCount


cycleCount? ​

optional cycleCount: number

Defined in: graph/src/graph.ts:33

Inherited from ​

GraphProperties.cycleCount


directed? ​

optional directed: boolean

Defined in: graph/src/graph.ts:28

Inherited from ​

GraphProperties.directed


edges? ​

optional edges: Set<IEdge<T>>

Defined in: graph/src/graph.ts:27

Inherited from ​

GraphProperties.edges


hasCycles? ​

optional hasCycles: boolean

Defined in: graph/src/graph.ts:34

Inherited from ​

GraphProperties.hasCycles


hasNegativeCycles? ​

optional hasNegativeCycles: boolean

Defined in: graph/src/graph.ts:35

Inherited from ​

GraphProperties.hasNegativeCycles


incidenceMatrix? ​

optional incidenceMatrix: IncidenceMatrix

Defined in: graph/src/graph.ts:93

Overrides ​

GraphProperties.incidenceMatrix


mixed? ​

optional mixed: boolean

Defined in: graph/src/graph.ts:29

Inherited from ​

GraphProperties.mixed


strongConnectedComponentsCount? ​

optional strongConnectedComponentsCount: number

Defined in: graph/src/graph.ts:32

Inherited from ​

GraphProperties.strongConnectedComponentsCount


title? ​

optional title: string

Defined in: graph/src/graph.ts:25

Inherited from ​

GraphProperties.title


useMatrixLayer? ​

optional useMatrixLayer: boolean

Defined in: graph/src/graph.ts:36

Inherited from ​

GraphProperties.useMatrixLayer


uuid? ​

optional uuid: string

Defined in: graph/src/graph.ts:24

Inherited from ​

GraphProperties.uuid


vertices? ​

optional vertices: Set<IVertex<T>>

Defined in: graph/src/graph.ts:26

Inherited from ​

GraphProperties.vertices


weightedAdjacencyMatrix? ​

optional weightedAdjacencyMatrix: WeightedAdjacencyMatrix

Defined in: graph/src/graph.ts:92

Overrides ​

GraphProperties.weightedAdjacencyMatrix

Methods ​

addEdge() ​

addEdge(e): boolean

Defined in: graph/src/graph.ts:83

Parameters ​

e ​

E

Returns ​

boolean


addVertex() ​

addVertex(v): boolean

Defined in: graph/src/graph.ts:87

Parameters ​

v ​

V

Returns ​

boolean


breadthFirstSearch() ​

breadthFirstSearch(startVertex): List<V>

Defined in: graph/src/graph.ts:51

Parameters ​

startVertex ​

V

Returns ​

List<V>


c() ​

c(from, to): number

Defined in: graph/src/graph.ts:90

Parameters ​

from ​

V

to ​

V

Returns ​

number


checkForCycles() ​

checkForCycles(): boolean

Defined in: graph/src/graph.ts:58

Returns ​

boolean


checkForNegativeCycles() ​

checkForNegativeCycles(): boolean

Defined in: graph/src/graph.ts:59

Returns ​

boolean


clear() ​

clear(): void

Defined in: graph/src/graph.ts:49

Returns ​

void


clearListeners() ​

clearListeners<Key>(event?): this

Defined in: event-emitter/dist/emitter.es.d.ts:35

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event? ​

Key

Returns ​

this

Description ​

Wrapper for clearing listeners for given event or all events.

Inherited from ​

EventEmitter.clearListeners


connectedComponents() ​

connectedComponents(): List<IGraph<T, V, E, Events>>

Defined in: graph/src/graph.ts:61

Returns ​

List<IGraph<T, V, E, Events>>


createEdge() ​

createEdge(from, to, title?, directed?, weight?): E

Defined in: graph/src/graph.ts:82

Parameters ​

from ​

V

to ​

V

title? ​

string

directed? ​

boolean

weight? ​

number

Returns ​

E


createVertex() ​

createVertex(title?, point?, object?): V

Defined in: graph/src/graph.ts:86

Parameters ​

title? ​

string

point? ​

Point

object? ​

any

Returns ​

V


density() ​

density(): number

Defined in: graph/src/graph.ts:67

Returns ​

number


depthFirstSearch() ​

depthFirstSearch(startVertex, L?): List<V>

Defined in: graph/src/graph.ts:50

Parameters ​

startVertex ​

V

L? ​

IStack<V>

Returns ​

List<V>


dijkstra() ​

dijkstra(startVertex, useWeightedMatrix?): SPPair<T, V>

Defined in: graph/src/graph.ts:52

Parameters ​

startVertex ​

V

useWeightedMatrix? ​

boolean

Returns ​

SPPair<T, V>


emit() ​

emit<Key>(event, ...args): boolean

Defined in: event-emitter/dist/emitter.es.d.ts:30

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event ​

Key

args ​

...Events[Key]

Returns ​

boolean

Description ​

Emit event.

Inherited from ​

EventEmitter.emit


filter() ​

filter(predicate): V[]

Defined in: graph/src/graph.ts:63

Parameters ​

predicate ​

(node) => boolean

Returns ​

V[]


findById() ​

findById(uuid): V | null

Defined in: graph/src/graph.ts:64

Parameters ​

uuid ​

string

Returns ​

V | null


infer() ​

infer(): void

Defined in: graph/src/graph.ts:48

Returns ​

void


inferCycles() ​

inferCycles(): Set<V[]> | null

Defined in: graph/src/graph.ts:60

Returns ​

Set<V[]> | null


isAcyclic() ​

isAcyclic(): boolean

Defined in: graph/src/graph.ts:72

Returns ​

boolean


isConnected() ​

isConnected(): boolean

Defined in: graph/src/graph.ts:76

Returns ​

boolean


isCyclic() ​

isCyclic(): boolean

Defined in: graph/src/graph.ts:71

Returns ​

boolean


isDense() ​

isDense(): boolean

Defined in: graph/src/graph.ts:79

Returns ​

boolean


isDirected() ​

isDirected(): boolean

Defined in: graph/src/graph.ts:75

Returns ​

boolean


isForest() ​

isForest(): boolean

Defined in: graph/src/graph.ts:74

Returns ​

boolean


isMixed() ​

isMixed(): boolean

Defined in: graph/src/graph.ts:78

Returns ​

boolean


isSparse() ​

isSparse(): boolean

Defined in: graph/src/graph.ts:80

Returns ​

boolean


isStronglyConnected() ​

isStronglyConnected(): boolean

Defined in: graph/src/graph.ts:77

Returns ​

boolean


isTree() ​

isTree(): boolean

Defined in: graph/src/graph.ts:73

Returns ​

boolean


kShortestPaths() ​

kShortestPaths(from, to, k): List<List<V>>

Defined in: graph/src/graph.ts:54

Parameters ​

from ​

V

to ​

V

k ​

number

Returns ​

List<List<V>>


listenerCount() ​

listenerCount<Key>(event?): number

Defined in: event-emitter/dist/emitter.es.d.ts:40

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event? ​

Key

Returns ​

number

Description ​

Count of listeners for a given event.

Inherited from ​

EventEmitter.listenerCount


minimalSpanningTree() ​

minimalSpanningTree(): IGraph<T, V, E, Events>

Defined in: graph/src/graph.ts:55

Returns ​

IGraph<T, V, E, Events>


off() ​

off<Key>(event, listener?): this

Defined in: event-emitter/dist/emitter.es.d.ts:18

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event ​

Key

listener? ​

Listener<Events[Key]>

Returns ​

this

Description ​

Remove listener for event or clear all listeners for given event.

Inherited from ​

EventEmitter.off


on() ​

on<Key>(event, listener): this

Defined in: event-emitter/dist/emitter.es.d.ts:12

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event ​

Key

listener ​

Listener<Events[Key]>

Returns ​

this

Description ​

Listen for an event.

Inherited from ​

EventEmitter.on


once() ​

once<Key>(event, listener): this

Defined in: event-emitter/dist/emitter.es.d.ts:24

Type Parameters ​

Key ​

Key extends string | number | symbol

Parameters ​

event ​

Key

listener ​

Listener<Events[Key]>

Returns ​

this

Description ​

Listen once for event.

Inherited from ​

EventEmitter.once


order() ​

order(): number

Defined in: graph/src/graph.ts:68

Returns ​

number


parallelTopologicalSorting() ​

parallelTopologicalSorting(): List<List<V>>

Defined in: graph/src/graph.ts:57

Returns ​

List<List<V>>


removeEdge() ​

removeEdge(e): boolean

Defined in: graph/src/graph.ts:84

Parameters ​

e ​

E

Returns ​

boolean


removeVertex() ​

removeVertex(v): boolean

Defined in: graph/src/graph.ts:88

Parameters ​

v ​

V

Returns ​

boolean


shortestPath() ​

shortestPath(from, to): List<V>

Defined in: graph/src/graph.ts:53

Parameters ​

from ​

V

to ​

V

Returns ​

List<V>


size() ​

size(): number

Defined in: graph/src/graph.ts:69

Returns ​

number


strongConnectedComponents() ​

strongConnectedComponents(): IGraph<T, V, E, Events>[]

Defined in: graph/src/graph.ts:62

Returns ​

IGraph<T, V, E, Events>[]


subgraph() ​

subgraph(predicate): IGraph<T, V, E, Events>

Defined in: graph/src/graph.ts:65

Parameters ​

predicate ​

(node) => boolean

Returns ​

IGraph<T, V, E, Events>


topologicalSorting() ​

topologicalSorting(): List<V>

Defined in: graph/src/graph.ts:56

Returns ​

List<V>

Built with VitePress – Released under the MIT License.