Typed API (TypeDoc) / IGraph
Interface: IGraph<T, V, E, Events>
Defined in: graph/src/graph.ts:47
Extends
GraphProperties<T>.EventEmitter<Events>
Type Parameters
T
T
V
V extends IVertex<T>
E
E extends IEdge<T>
Events
Events extends GraphEvents<T>
Properties
adjacencyMatrix?
optionaladjacencyMatrix:AdjacencyMatrix
Defined in: graph/src/graph.ts:91
Overrides
GraphProperties.adjacencyMatrix
connected?
optionalconnected:boolean
Defined in: graph/src/graph.ts:30
Inherited from
GraphProperties.connected
connectedComponentsCount?
optionalconnectedComponentsCount:number
Defined in: graph/src/graph.ts:31
Inherited from
GraphProperties.connectedComponentsCount
cycleCount?
optionalcycleCount:number
Defined in: graph/src/graph.ts:33
Inherited from
GraphProperties.cycleCount
directed?
optionaldirected:boolean
Defined in: graph/src/graph.ts:28
Inherited from
GraphProperties.directed
edges?
Defined in: graph/src/graph.ts:27
Inherited from
GraphProperties.edges
hasCycles?
optionalhasCycles:boolean
Defined in: graph/src/graph.ts:34
Inherited from
GraphProperties.hasCycles
hasNegativeCycles?
optionalhasNegativeCycles:boolean
Defined in: graph/src/graph.ts:35
Inherited from
GraphProperties.hasNegativeCycles
incidenceMatrix?
optionalincidenceMatrix:IncidenceMatrix
Defined in: graph/src/graph.ts:93
Overrides
GraphProperties.incidenceMatrix
mixed?
optionalmixed:boolean
Defined in: graph/src/graph.ts:29
Inherited from
GraphProperties.mixed
strongConnectedComponentsCount?
optionalstrongConnectedComponentsCount:number
Defined in: graph/src/graph.ts:32
Inherited from
GraphProperties.strongConnectedComponentsCount
title?
optionaltitle:string
Defined in: graph/src/graph.ts:25
Inherited from
GraphProperties.title
useMatrixLayer?
optionaluseMatrixLayer:boolean
Defined in: graph/src/graph.ts:36
Inherited from
GraphProperties.useMatrixLayer
uuid?
optionaluuid:string
Defined in: graph/src/graph.ts:24
Inherited from
GraphProperties.uuid
vertices?
Defined in: graph/src/graph.ts:26
Inherited from
GraphProperties.vertices
weightedAdjacencyMatrix?
optionalweightedAdjacencyMatrix: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>