data-structure-typed 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/CHANGELOG.md +9 -1
- package/dist/cjs/binary-tree.cjs +2927 -23688
- package/dist/cjs/graph.cjs +845 -2634
- package/dist/cjs/hash.cjs +185 -616
- package/dist/cjs/heap.cjs +266 -818
- package/dist/cjs/index.cjs +5116 -31358
- package/dist/cjs/linked-list.cjs +644 -2615
- package/dist/cjs/matrix.cjs +220 -535
- package/dist/cjs/priority-queue.cjs +266 -818
- package/dist/cjs/queue.cjs +637 -2343
- package/dist/cjs/stack.cjs +124 -530
- package/dist/cjs/trie.cjs +145 -592
- package/dist/cjs-legacy/binary-tree.cjs +4352 -25113
- package/dist/cjs-legacy/graph.cjs +847 -2636
- package/dist/cjs-legacy/hash.cjs +181 -612
- package/dist/cjs-legacy/heap.cjs +266 -818
- package/dist/cjs-legacy/index.cjs +6657 -32899
- package/dist/cjs-legacy/linked-list.cjs +640 -2611
- package/dist/cjs-legacy/matrix.cjs +220 -535
- package/dist/cjs-legacy/priority-queue.cjs +266 -818
- package/dist/cjs-legacy/queue.cjs +634 -2340
- package/dist/cjs-legacy/stack.cjs +124 -530
- package/dist/cjs-legacy/trie.cjs +145 -592
- package/dist/esm/binary-tree.mjs +2927 -23688
- package/dist/esm/graph.mjs +845 -2634
- package/dist/esm/hash.mjs +185 -616
- package/dist/esm/heap.mjs +266 -818
- package/dist/esm/index.mjs +5116 -31358
- package/dist/esm/linked-list.mjs +644 -2615
- package/dist/esm/matrix.mjs +220 -535
- package/dist/esm/priority-queue.mjs +266 -818
- package/dist/esm/queue.mjs +637 -2343
- package/dist/esm/stack.mjs +124 -530
- package/dist/esm/trie.mjs +145 -592
- package/dist/esm-legacy/binary-tree.mjs +4352 -25113
- package/dist/esm-legacy/graph.mjs +847 -2636
- package/dist/esm-legacy/hash.mjs +181 -612
- package/dist/esm-legacy/heap.mjs +266 -818
- package/dist/esm-legacy/index.mjs +6657 -32899
- package/dist/esm-legacy/linked-list.mjs +640 -2611
- package/dist/esm-legacy/matrix.mjs +220 -535
- package/dist/esm-legacy/priority-queue.mjs +266 -818
- package/dist/esm-legacy/queue.mjs +634 -2340
- package/dist/esm-legacy/stack.mjs +124 -530
- package/dist/esm-legacy/trie.mjs +145 -592
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +29 -500
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +38 -563
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +230 -1212
- package/dist/types/data-structures/binary-tree/bst.d.ts +124 -1063
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +99 -854
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +62 -314
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +366 -5057
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +277 -4885
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +253 -3929
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +261 -4782
- package/dist/types/data-structures/graph/abstract-graph.d.ts +44 -44
- package/dist/types/data-structures/graph/directed-graph.d.ts +130 -527
- package/dist/types/data-structures/graph/undirected-graph.d.ts +125 -482
- package/dist/types/data-structures/hash/hash-map.d.ts +132 -562
- package/dist/types/data-structures/heap/heap.d.ts +194 -746
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +120 -809
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -733
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +193 -863
- package/dist/types/data-structures/matrix/matrix.d.ts +159 -474
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -6
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +6 -11
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/types/data-structures/queue/deque.d.ts +196 -804
- package/dist/types/data-structures/queue/queue.d.ts +99 -585
- package/dist/types/data-structures/stack/stack.d.ts +75 -481
- package/dist/types/data-structures/trie/trie.d.ts +98 -584
- package/dist/umd/data-structure-typed.js +6580 -32822
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +162 -215
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +47 -47
- package/docs-site-docusaurus/docs/api/classes/BST.md +155 -208
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +7 -7
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -29
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +104 -158
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +253 -101
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +244 -114
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +52 -48
- package/docs-site-docusaurus/docs/api/classes/Heap.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +84 -14
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +138 -34
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +149 -41
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +172 -92
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +57 -52
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +120 -70
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +125 -75
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/Queue.md +158 -74
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +171 -225
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -22
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +172 -94
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +4 -4
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +98 -75
- package/docs-site-docusaurus/docs/api/classes/Stack.md +112 -50
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +104 -129
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +90 -121
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +298 -107
- package/docs-site-docusaurus/docs/api/classes/Trie.md +116 -58
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +59 -77
- package/package.json +45 -46
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +0 -3
- package/src/data-structures/base/linear-base.ts +2 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -529
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
- package/src/data-structures/binary-tree/bst.ts +158 -1082
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
- package/src/data-structures/binary-tree/segment-tree.ts +73 -351
- package/src/data-structures/binary-tree/tree-map.ts +462 -5124
- package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
- package/src/data-structures/binary-tree/tree-multi-set.ts +299 -3983
- package/src/data-structures/binary-tree/tree-set.ts +338 -4836
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -562
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -511
- package/src/data-structures/hash/hash-map.ts +154 -582
- package/src/data-structures/heap/heap.ts +200 -795
- package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
- package/src/data-structures/matrix/matrix.ts +179 -518
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +214 -882
- package/src/data-structures/queue/queue.ts +102 -625
- package/src/data-structures/stack/stack.ts +76 -505
- package/src/data-structures/trie/trie.ts +98 -628
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DirectedGraph\<V, E, VO, EO\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
9
|
+
Defined in: [data-structures/graph/directed-graph.ts:117](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L117)
|
|
10
10
|
|
|
11
11
|
Directed graph implementation.
|
|
12
12
|
|
|
@@ -147,7 +147,7 @@ Concrete edge class (extends AbstractEdge<E>).
|
|
|
147
147
|
new DirectedGraph<V, E, VO, EO>(options?): DirectedGraph<V, E, VO, EO>;
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
150
|
+
Defined in: [data-structures/graph/directed-graph.ts:131](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L131)
|
|
151
151
|
|
|
152
152
|
Construct a directed graph with runtime defaults.
|
|
153
153
|
|
|
@@ -181,7 +181,7 @@ Time O(1), Space O(1)
|
|
|
181
181
|
get size(): number;
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
184
|
+
Defined in: [data-structures/graph/abstract-graph.ts:85](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L85)
|
|
185
185
|
|
|
186
186
|
Total number of entries.
|
|
187
187
|
|
|
@@ -263,7 +263,7 @@ Time O(1) avg, Space O(1)
|
|
|
263
263
|
addEdge(edge): boolean;
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
266
|
+
Defined in: [data-structures/graph/abstract-graph.ts:258](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L258)
|
|
267
267
|
|
|
268
268
|
##### Parameters
|
|
269
269
|
|
|
@@ -289,7 +289,7 @@ addEdge(
|
|
|
289
289
|
value?): boolean;
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
292
|
+
Defined in: [data-structures/graph/abstract-graph.ts:260](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L260)
|
|
293
293
|
|
|
294
294
|
##### Parameters
|
|
295
295
|
|
|
@@ -341,7 +341,7 @@ Time O(1) avg, Space O(1)
|
|
|
341
341
|
addVertex(vertex): boolean;
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
344
|
+
Defined in: [data-structures/graph/abstract-graph.ts:193](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L193)
|
|
345
345
|
|
|
346
346
|
##### Parameters
|
|
347
347
|
|
|
@@ -369,7 +369,7 @@ IGraph.addVertex
|
|
|
369
369
|
addVertex(key, value?): boolean;
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
372
|
+
Defined in: [data-structures/graph/abstract-graph.ts:195](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L195)
|
|
373
373
|
|
|
374
374
|
##### Parameters
|
|
375
375
|
|
|
@@ -407,7 +407,7 @@ bellmanFord(
|
|
|
407
407
|
genPath?): object;
|
|
408
408
|
```
|
|
409
409
|
|
|
410
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
410
|
+
Defined in: [data-structures/graph/abstract-graph.ts:677](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L677)
|
|
411
411
|
|
|
412
412
|
Bellman-Ford single-source shortest paths with option to scan negative cycles.
|
|
413
413
|
|
|
@@ -495,7 +495,7 @@ Time O(V * E), Space O(V + E)
|
|
|
495
495
|
clear(): void;
|
|
496
496
|
```
|
|
497
497
|
|
|
498
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
498
|
+
Defined in: [data-structures/graph/directed-graph.ts:634](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L634)
|
|
499
499
|
|
|
500
500
|
Remove all vertices and edges.
|
|
501
501
|
|
|
@@ -525,7 +525,7 @@ IGraph.clear
|
|
|
525
525
|
clone(): this;
|
|
526
526
|
```
|
|
527
527
|
|
|
528
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
528
|
+
Defined in: [data-structures/graph/directed-graph.ts:645](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L645)
|
|
529
529
|
|
|
530
530
|
Deep clone as the same concrete class.
|
|
531
531
|
|
|
@@ -561,7 +561,7 @@ createEdge(
|
|
|
561
561
|
value?): EO;
|
|
562
562
|
```
|
|
563
563
|
|
|
564
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
564
|
+
Defined in: [data-structures/graph/directed-graph.ts:214](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L214)
|
|
565
565
|
|
|
566
566
|
Create a directed edge instance. Does not insert into the graph.
|
|
567
567
|
|
|
@@ -619,7 +619,7 @@ IGraph.createEdge
|
|
|
619
619
|
createVertex(key, value?): VO;
|
|
620
620
|
```
|
|
621
621
|
|
|
622
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
622
|
+
Defined in: [data-structures/graph/directed-graph.ts:201](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L201)
|
|
623
623
|
|
|
624
624
|
Create a directed vertex instance. Does not insert into the graph.
|
|
625
625
|
|
|
@@ -665,7 +665,7 @@ IGraph.createVertex
|
|
|
665
665
|
degreeOf(vertexOrKey): number;
|
|
666
666
|
```
|
|
667
667
|
|
|
668
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
668
|
+
Defined in: [data-structures/graph/directed-graph.ts:434](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L434)
|
|
669
669
|
|
|
670
670
|
Degree (in + out) of a vertex.
|
|
671
671
|
|
|
@@ -705,7 +705,7 @@ IGraph.degreeOf
|
|
|
705
705
|
deleteEdge(edgeOrSrcVertexKey, destVertexKey?): EO | undefined;
|
|
706
706
|
```
|
|
707
707
|
|
|
708
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
708
|
+
Defined in: [data-structures/graph/directed-graph.ts:305](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L305)
|
|
709
709
|
|
|
710
710
|
Delete an edge by instance or by `(srcKey, destKey)`.
|
|
711
711
|
|
|
@@ -733,8 +733,6 @@ Removed edge or `undefined`.
|
|
|
733
733
|
|
|
734
734
|
Time O(1) avg, Space O(1)
|
|
735
735
|
|
|
736
|
-
*
|
|
737
|
-
|
|
738
736
|
#### Example
|
|
739
737
|
|
|
740
738
|
```ts
|
|
@@ -782,7 +780,7 @@ IGraph.deleteEdge
|
|
|
782
780
|
deleteEdgeSrcToDest(srcOrKey, destOrKey): EO | undefined;
|
|
783
781
|
```
|
|
784
782
|
|
|
785
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
783
|
+
Defined in: [data-structures/graph/directed-graph.ts:255](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L255)
|
|
786
784
|
|
|
787
785
|
Delete edge `src -> dest` if present.
|
|
788
786
|
|
|
@@ -818,12 +816,10 @@ Time O(1) avg, Space O(1)
|
|
|
818
816
|
deleteVertex(vertexOrKey): boolean;
|
|
819
817
|
```
|
|
820
818
|
|
|
821
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
819
|
+
Defined in: [data-structures/graph/directed-graph.ts:344](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L344)
|
|
822
820
|
|
|
823
821
|
Remove a vertex
|
|
824
822
|
|
|
825
|
-
*
|
|
826
|
-
|
|
827
823
|
#### Parameters
|
|
828
824
|
|
|
829
825
|
##### vertexOrKey
|
|
@@ -869,7 +865,7 @@ dijkstraWithoutHeap(
|
|
|
869
865
|
genPaths?): DijkstraResult<VO>;
|
|
870
866
|
```
|
|
871
867
|
|
|
872
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
868
|
+
Defined in: [data-structures/graph/abstract-graph.ts:478](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L478)
|
|
873
869
|
|
|
874
870
|
Dijkstra without heap (array-based selection).
|
|
875
871
|
|
|
@@ -921,12 +917,10 @@ Time O(V^2 + E), Space O(V + E)
|
|
|
921
917
|
edgeSet(): EO[];
|
|
922
918
|
```
|
|
923
919
|
|
|
924
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
920
|
+
Defined in: [data-structures/graph/directed-graph.ts:567](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L567)
|
|
925
921
|
|
|
926
922
|
Get all edges
|
|
927
923
|
|
|
928
|
-
*
|
|
929
|
-
|
|
930
924
|
#### Returns
|
|
931
925
|
|
|
932
926
|
`EO`[]
|
|
@@ -960,7 +954,7 @@ IGraph.edgeSet
|
|
|
960
954
|
edgesOf(vertexOrKey): EO[];
|
|
961
955
|
```
|
|
962
956
|
|
|
963
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
957
|
+
Defined in: [data-structures/graph/directed-graph.ts:464](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L464)
|
|
964
958
|
|
|
965
959
|
All incident edges of a vertex.
|
|
966
960
|
|
|
@@ -1066,7 +1060,7 @@ Time O(n), Space O(1)
|
|
|
1066
1060
|
filter(predicate, thisArg?): this;
|
|
1067
1061
|
```
|
|
1068
1062
|
|
|
1069
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1063
|
+
Defined in: [data-structures/graph/abstract-graph.ts:847](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L847)
|
|
1070
1064
|
|
|
1071
1065
|
Induced-subgraph filter: keep vertices where `predicate(key, value)` is true,
|
|
1072
1066
|
and only keep edges whose endpoints both survive.
|
|
@@ -1113,7 +1107,7 @@ IGraph.filter
|
|
|
1113
1107
|
filterEntries(predicate, thisArg?): [VertexKey, V | undefined][];
|
|
1114
1108
|
```
|
|
1115
1109
|
|
|
1116
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1110
|
+
Defined in: [data-structures/graph/abstract-graph.ts:863](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L863)
|
|
1117
1111
|
|
|
1118
1112
|
Preserve the old behavior: return filtered entries as an array.
|
|
1119
1113
|
|
|
@@ -1187,7 +1181,7 @@ Time O(n), Space O(1)
|
|
|
1187
1181
|
floydWarshall(): object;
|
|
1188
1182
|
```
|
|
1189
1183
|
|
|
1190
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1184
|
+
Defined in: [data-structures/graph/abstract-graph.ts:760](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L760)
|
|
1191
1185
|
|
|
1192
1186
|
Floyd–Warshall all-pairs shortest paths.
|
|
1193
1187
|
|
|
@@ -1300,7 +1294,7 @@ getAllPathsBetween(
|
|
|
1300
1294
|
limit?): VO[][];
|
|
1301
1295
|
```
|
|
1302
1296
|
|
|
1303
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1297
|
+
Defined in: [data-structures/graph/abstract-graph.ts:316](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L316)
|
|
1304
1298
|
|
|
1305
1299
|
Enumerate simple paths up to a limit.
|
|
1306
1300
|
|
|
@@ -1346,7 +1340,7 @@ Time O(paths) worst-case exponential, Space O(V + paths)
|
|
|
1346
1340
|
getCycles(isInclude2Cycle?): VertexKey[][];
|
|
1347
1341
|
```
|
|
1348
1342
|
|
|
1349
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1343
|
+
Defined in: [data-structures/graph/abstract-graph.ts:796](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L796)
|
|
1350
1344
|
|
|
1351
1345
|
Enumerate simple cycles (may be expensive).
|
|
1352
1346
|
|
|
@@ -1380,7 +1374,7 @@ Time exponential in worst-case, Space O(V + E)
|
|
|
1380
1374
|
getDestinations(vertex): VO[];
|
|
1381
1375
|
```
|
|
1382
1376
|
|
|
1383
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1377
|
+
Defined in: [data-structures/graph/directed-graph.ts:482](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L482)
|
|
1384
1378
|
|
|
1385
1379
|
Direct children reachable by one outgoing edge.
|
|
1386
1380
|
|
|
@@ -1410,7 +1404,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
1410
1404
|
getDFNMap(): Map<VO, number>;
|
|
1411
1405
|
```
|
|
1412
1406
|
|
|
1413
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1407
|
+
Defined in: [data-structures/graph/directed-graph.ts:713](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L713)
|
|
1414
1408
|
|
|
1415
1409
|
DFN index map computed by `tarjan()`.
|
|
1416
1410
|
|
|
@@ -1432,7 +1426,7 @@ Time O(V), Space O(V)
|
|
|
1432
1426
|
getEdge(srcOrKey, destOrKey): EO | undefined;
|
|
1433
1427
|
```
|
|
1434
1428
|
|
|
1435
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1429
|
+
Defined in: [data-structures/graph/directed-graph.ts:233](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L233)
|
|
1436
1430
|
|
|
1437
1431
|
Get the unique edge from `src` to `dest`, if present.
|
|
1438
1432
|
|
|
@@ -1460,8 +1454,6 @@ Edge instance or `undefined`.
|
|
|
1460
1454
|
|
|
1461
1455
|
Time O(1) avg, Space O(1)
|
|
1462
1456
|
|
|
1463
|
-
*
|
|
1464
|
-
|
|
1465
1457
|
#### Example
|
|
1466
1458
|
|
|
1467
1459
|
```ts
|
|
@@ -1492,7 +1484,7 @@ IGraph.getEdge
|
|
|
1492
1484
|
getEndsOfEdge(edge): [VO, VO] | undefined;
|
|
1493
1485
|
```
|
|
1494
1486
|
|
|
1495
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1487
|
+
Defined in: [data-structures/graph/directed-graph.ts:609](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L609)
|
|
1496
1488
|
|
|
1497
1489
|
Resolve an edge's `[src, dest]` endpoints to vertex instances.
|
|
1498
1490
|
|
|
@@ -1532,7 +1524,7 @@ IGraph.getEndsOfEdge
|
|
|
1532
1524
|
getLowMap(): Map<VO, number>;
|
|
1533
1525
|
```
|
|
1534
1526
|
|
|
1535
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1527
|
+
Defined in: [data-structures/graph/directed-graph.ts:722](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L722)
|
|
1536
1528
|
|
|
1537
1529
|
LOW link map computed by `tarjan()`.
|
|
1538
1530
|
|
|
@@ -1557,7 +1549,7 @@ getMinCostBetween(
|
|
|
1557
1549
|
isWeight?): number | undefined;
|
|
1558
1550
|
```
|
|
1559
1551
|
|
|
1560
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1552
|
+
Defined in: [data-structures/graph/abstract-graph.ts:364](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L364)
|
|
1561
1553
|
|
|
1562
1554
|
Minimum hops/weight between two vertices.
|
|
1563
1555
|
|
|
@@ -1607,7 +1599,7 @@ getMinPathBetween(
|
|
|
1607
1599
|
isDFS?): VO[] | undefined;
|
|
1608
1600
|
```
|
|
1609
1601
|
|
|
1610
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1602
|
+
Defined in: [data-structures/graph/abstract-graph.ts:414](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L414)
|
|
1611
1603
|
|
|
1612
1604
|
Minimum path (as vertex sequence) between two vertices.
|
|
1613
1605
|
|
|
@@ -1659,12 +1651,10 @@ Time O((V + E) log V) weighted / O(V + E) unweighted, Space O(V + E)
|
|
|
1659
1651
|
getNeighbors(vertexOrKey): VO[];
|
|
1660
1652
|
```
|
|
1661
1653
|
|
|
1662
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1654
|
+
Defined in: [data-structures/graph/directed-graph.ts:588](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L588)
|
|
1663
1655
|
|
|
1664
1656
|
Get outgoing neighbors
|
|
1665
1657
|
|
|
1666
|
-
*
|
|
1667
|
-
|
|
1668
1658
|
#### Parameters
|
|
1669
1659
|
|
|
1670
1660
|
##### vertexOrKey
|
|
@@ -1707,7 +1697,7 @@ IGraph.getNeighbors
|
|
|
1707
1697
|
getPathSumWeight(path): number;
|
|
1708
1698
|
```
|
|
1709
1699
|
|
|
1710
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1700
|
+
Defined in: [data-structures/graph/abstract-graph.ts:348](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L348)
|
|
1711
1701
|
|
|
1712
1702
|
Sum the weights along a vertex path.
|
|
1713
1703
|
|
|
@@ -1741,7 +1731,7 @@ Time O(L), Space O(1) where L is path length
|
|
|
1741
1731
|
getSCCs(): Map<number, VO[]>;
|
|
1742
1732
|
```
|
|
1743
1733
|
|
|
1744
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1734
|
+
Defined in: [data-structures/graph/directed-graph.ts:742](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L742)
|
|
1745
1735
|
|
|
1746
1736
|
Strongly connected components computed by `tarjan()`.
|
|
1747
1737
|
|
|
@@ -1755,8 +1745,6 @@ Map from SCC id to vertices.
|
|
|
1755
1745
|
|
|
1756
1746
|
Time O(#SCC + V), Space O(V)
|
|
1757
1747
|
|
|
1758
|
-
*
|
|
1759
|
-
|
|
1760
1748
|
#### Example
|
|
1761
1749
|
|
|
1762
1750
|
```ts
|
|
@@ -1780,7 +1768,7 @@ Time O(#SCC + V), Space O(V)
|
|
|
1780
1768
|
getVertex(vertexKey): VO | undefined;
|
|
1781
1769
|
```
|
|
1782
1770
|
|
|
1783
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1771
|
+
Defined in: [data-structures/graph/abstract-graph.ts:179](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L179)
|
|
1784
1772
|
|
|
1785
1773
|
Get vertex instance by key.
|
|
1786
1774
|
|
|
@@ -1854,7 +1842,7 @@ Time O(n) generic, Space O(1)
|
|
|
1854
1842
|
hasEdge(v1, v2): boolean;
|
|
1855
1843
|
```
|
|
1856
1844
|
|
|
1857
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1845
|
+
Defined in: [data-structures/graph/abstract-graph.ts:253](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L253)
|
|
1858
1846
|
|
|
1859
1847
|
Whether an edge exists between two vertices.
|
|
1860
1848
|
|
|
@@ -1928,7 +1916,7 @@ Time O(n), Space O(1)
|
|
|
1928
1916
|
hasVertex(vertexOrKey): boolean;
|
|
1929
1917
|
```
|
|
1930
1918
|
|
|
1931
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
1919
|
+
Defined in: [data-structures/graph/abstract-graph.ts:189](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L189)
|
|
1932
1920
|
|
|
1933
1921
|
Whether a vertex exists.
|
|
1934
1922
|
|
|
@@ -1968,7 +1956,7 @@ IGraph.hasVertex
|
|
|
1968
1956
|
incomingEdgesOf(vertexOrKey): EO[];
|
|
1969
1957
|
```
|
|
1970
1958
|
|
|
1971
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1959
|
+
Defined in: [data-structures/graph/directed-graph.ts:397](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L397)
|
|
1972
1960
|
|
|
1973
1961
|
Incoming edges of a vertex.
|
|
1974
1962
|
|
|
@@ -1990,8 +1978,6 @@ Array of incoming edges.
|
|
|
1990
1978
|
|
|
1991
1979
|
Time O(deg_in), Space O(deg_in)
|
|
1992
1980
|
|
|
1993
|
-
*
|
|
1994
|
-
|
|
1995
1981
|
#### Example
|
|
1996
1982
|
|
|
1997
1983
|
```ts
|
|
@@ -2013,7 +1999,7 @@ Time O(deg_in), Space O(deg_in)
|
|
|
2013
1999
|
isEmpty(): boolean;
|
|
2014
2000
|
```
|
|
2015
2001
|
|
|
2016
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2002
|
+
Defined in: [data-structures/graph/directed-graph.ts:626](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L626)
|
|
2017
2003
|
|
|
2018
2004
|
Whether the graph has no vertices and no edges.
|
|
2019
2005
|
|
|
@@ -2043,7 +2029,7 @@ IGraph.isEmpty
|
|
|
2043
2029
|
isVertexKey(potentialKey): potentialKey is VertexKey;
|
|
2044
2030
|
```
|
|
2045
2031
|
|
|
2046
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2032
|
+
Defined in: [data-structures/graph/abstract-graph.ts:219](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L219)
|
|
2047
2033
|
|
|
2048
2034
|
Type guard: check if a value is a valid vertex key.
|
|
2049
2035
|
|
|
@@ -2103,7 +2089,7 @@ Time O(n), Space O(1)
|
|
|
2103
2089
|
map<T>(callback, thisArg?): T[];
|
|
2104
2090
|
```
|
|
2105
2091
|
|
|
2106
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2092
|
+
Defined in: [data-structures/graph/abstract-graph.ts:878](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L878)
|
|
2107
2093
|
|
|
2108
2094
|
Map entries using an implementation-specific strategy.
|
|
2109
2095
|
|
|
@@ -2143,7 +2129,7 @@ Time O(n), Space O(n)
|
|
|
2143
2129
|
outgoingEdgesOf(vertexOrKey): EO[];
|
|
2144
2130
|
```
|
|
2145
2131
|
|
|
2146
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2132
|
+
Defined in: [data-structures/graph/directed-graph.ts:420](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L420)
|
|
2147
2133
|
|
|
2148
2134
|
Outgoing edges of a vertex.
|
|
2149
2135
|
|
|
@@ -2165,8 +2151,6 @@ Array of outgoing edges.
|
|
|
2165
2151
|
|
|
2166
2152
|
Time O(deg_out), Space O(deg_out)
|
|
2167
2153
|
|
|
2168
|
-
*
|
|
2169
|
-
|
|
2170
2154
|
#### Example
|
|
2171
2155
|
|
|
2172
2156
|
```ts
|
|
@@ -2188,7 +2172,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
2188
2172
|
print(options?): void;
|
|
2189
2173
|
```
|
|
2190
2174
|
|
|
2191
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2175
|
+
Defined in: [data-structures/graph/abstract-graph.ts:984](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L984)
|
|
2192
2176
|
|
|
2193
2177
|
Print the graph to console.
|
|
2194
2178
|
|
|
@@ -2264,7 +2248,7 @@ Time O(n), Space O(1)
|
|
|
2264
2248
|
removeManyVertices(vertexMap): boolean;
|
|
2265
2249
|
```
|
|
2266
2250
|
|
|
2267
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2251
|
+
Defined in: [data-structures/graph/abstract-graph.ts:238](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L238)
|
|
2268
2252
|
|
|
2269
2253
|
Delete multiple vertices.
|
|
2270
2254
|
|
|
@@ -2301,7 +2285,7 @@ setEdgeWeight(
|
|
|
2301
2285
|
weight): boolean;
|
|
2302
2286
|
```
|
|
2303
2287
|
|
|
2304
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2288
|
+
Defined in: [data-structures/graph/abstract-graph.ts:298](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L298)
|
|
2305
2289
|
|
|
2306
2290
|
Set the weight of an existing edge.
|
|
2307
2291
|
|
|
@@ -2387,7 +2371,7 @@ Time O(n), Space O(1)
|
|
|
2387
2371
|
tarjan(): object;
|
|
2388
2372
|
```
|
|
2389
2373
|
|
|
2390
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2374
|
+
Defined in: [data-structures/graph/directed-graph.ts:667](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L667)
|
|
2391
2375
|
|
|
2392
2376
|
Tarjan's algorithm for strongly connected components.
|
|
2393
2377
|
|
|
@@ -2419,8 +2403,6 @@ SCCs: Map<number, VO[]>;
|
|
|
2419
2403
|
|
|
2420
2404
|
Time O(V + E), Space O(V + E)
|
|
2421
2405
|
|
|
2422
|
-
*
|
|
2423
|
-
|
|
2424
2406
|
#### Example
|
|
2425
2407
|
|
|
2426
2408
|
```ts
|
|
@@ -2472,7 +2454,7 @@ Time O(n), Space O(n)
|
|
|
2472
2454
|
toDot(options?): string;
|
|
2473
2455
|
```
|
|
2474
2456
|
|
|
2475
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2457
|
+
Defined in: [data-structures/graph/abstract-graph.ts:952](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L952)
|
|
2476
2458
|
|
|
2477
2459
|
Generate DOT language representation for Graphviz.
|
|
2478
2460
|
|
|
@@ -2512,7 +2494,7 @@ DOT format string.
|
|
|
2512
2494
|
topologicalSort(propertyName?): (VertexKey | VO)[] | undefined;
|
|
2513
2495
|
```
|
|
2514
2496
|
|
|
2515
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2497
|
+
Defined in: [data-structures/graph/directed-graph.ts:525](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L525)
|
|
2516
2498
|
|
|
2517
2499
|
Topological sort if DAG; returns `undefined` if a cycle exists.
|
|
2518
2500
|
|
|
@@ -2534,8 +2516,6 @@ Array of keys/vertices, or `undefined` when cycle is found.
|
|
|
2534
2516
|
|
|
2535
2517
|
Time O(V + E), Space O(V)
|
|
2536
2518
|
|
|
2537
|
-
*
|
|
2538
|
-
|
|
2539
2519
|
#### Example
|
|
2540
2520
|
|
|
2541
2521
|
```ts
|
|
@@ -2570,7 +2550,7 @@ Time O(V + E), Space O(V)
|
|
|
2570
2550
|
toVisual(options?): string;
|
|
2571
2551
|
```
|
|
2572
2552
|
|
|
2573
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2553
|
+
Defined in: [data-structures/graph/abstract-graph.ts:920](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L920)
|
|
2574
2554
|
|
|
2575
2555
|
Generate a text-based visual representation of the graph.
|
|
2576
2556
|
|
|
@@ -2640,7 +2620,7 @@ Time O(n), Space O(1)
|
|
|
2640
2620
|
static fromEntries<V>(entries): DirectedGraph<V, undefined, DirectedVertex<V>, DirectedEdge<undefined>>;
|
|
2641
2621
|
```
|
|
2642
2622
|
|
|
2643
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2623
|
+
Defined in: [data-structures/graph/directed-graph.ts:183](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L183)
|
|
2644
2624
|
|
|
2645
2625
|
Construct a directed graph from `[key, value]` entries.
|
|
2646
2626
|
|
|
@@ -2678,7 +2658,7 @@ Time O(V), Space O(V)
|
|
|
2678
2658
|
static fromKeys<K>(keys): DirectedGraph<K, undefined, DirectedVertex<K>, DirectedEdge<undefined>>;
|
|
2679
2659
|
```
|
|
2680
2660
|
|
|
2681
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2661
|
+
Defined in: [data-structures/graph/directed-graph.ts:166](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L166)
|
|
2682
2662
|
|
|
2683
2663
|
Construct a directed graph from keys with value initializer `v => v`.
|
|
2684
2664
|
|
|
@@ -2721,7 +2701,7 @@ Time O(V), Space O(V)
|
|
|
2721
2701
|
get protected _edgeConnector(): string;
|
|
2722
2702
|
```
|
|
2723
2703
|
|
|
2724
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2704
|
+
Defined in: [data-structures/graph/directed-graph.ts:155](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L155)
|
|
2725
2705
|
|
|
2726
2706
|
The edge connector string used in visual output.
|
|
2727
2707
|
Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
@@ -2742,7 +2722,7 @@ Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
|
2742
2722
|
protected _addEdge(edge): boolean;
|
|
2743
2723
|
```
|
|
2744
2724
|
|
|
2745
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2725
|
+
Defined in: [data-structures/graph/directed-graph.ts:752](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L752)
|
|
2746
2726
|
|
|
2747
2727
|
Internal hook to attach a directed edge into adjacency maps.
|
|
2748
2728
|
|
|
@@ -2776,7 +2756,7 @@ Time O(1) avg, Space O(1)
|
|
|
2776
2756
|
protected _addVertex(newVertex): boolean;
|
|
2777
2757
|
```
|
|
2778
2758
|
|
|
2779
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2759
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1089](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1089)
|
|
2780
2760
|
|
|
2781
2761
|
Insert a pre-built vertex into the graph.
|
|
2782
2762
|
|
|
@@ -2810,7 +2790,7 @@ Time O(1) avg, Space O(1)
|
|
|
2810
2790
|
protected _createInstance(_options?): this;
|
|
2811
2791
|
```
|
|
2812
2792
|
|
|
2813
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2793
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1022](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1022)
|
|
2814
2794
|
|
|
2815
2795
|
Create an empty graph instance of the same concrete species.
|
|
2816
2796
|
|
|
@@ -2844,7 +2824,7 @@ Time O(1), Space O(1)
|
|
|
2844
2824
|
protected _createLike(iter?, options?): this;
|
|
2845
2825
|
```
|
|
2846
2826
|
|
|
2847
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2827
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1044](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1044)
|
|
2848
2828
|
|
|
2849
2829
|
Create a same-species graph populated with entries; preserves edges among kept vertices.
|
|
2850
2830
|
|
|
@@ -2884,7 +2864,7 @@ Time O(V + E), Space O(V + E)
|
|
|
2884
2864
|
protected _getIterator(): IterableIterator<[VertexKey, V | undefined]>;
|
|
2885
2865
|
```
|
|
2886
2866
|
|
|
2887
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2867
|
+
Defined in: [data-structures/graph/abstract-graph.ts:993](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L993)
|
|
2888
2868
|
|
|
2889
2869
|
Internal iterator over `[key, value]` entries in insertion order.
|
|
2890
2870
|
|
|
@@ -2910,7 +2890,7 @@ Time O(V), Space O(1)
|
|
|
2910
2890
|
protected _getVertex(vertexOrKey): VO | undefined;
|
|
2911
2891
|
```
|
|
2912
2892
|
|
|
2913
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2893
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1103](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1103)
|
|
2914
2894
|
|
|
2915
2895
|
Resolve a vertex key or instance to the concrete vertex instance.
|
|
2916
2896
|
|
|
@@ -2944,7 +2924,7 @@ Time O(1), Space O(1)
|
|
|
2944
2924
|
protected _getVertexKey(vertexOrKey): VertexKey;
|
|
2945
2925
|
```
|
|
2946
2926
|
|
|
2947
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2927
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1114](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1114)
|
|
2948
2928
|
|
|
2949
2929
|
Resolve a vertex key from a key or vertex instance.
|
|
2950
2930
|
|
|
@@ -2978,7 +2958,7 @@ Time O(1), Space O(1)
|
|
|
2978
2958
|
protected _snapshotOptions(): Record<string, unknown>;
|
|
2979
2959
|
```
|
|
2980
2960
|
|
|
2981
|
-
Defined in: [data-structures/graph/abstract-graph.ts:
|
|
2961
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1008](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1008)
|
|
2982
2962
|
|
|
2983
2963
|
Capture configuration needed to reproduce the current graph.
|
|
2984
2964
|
|