data-structure-typed 2.5.2 → 2.6.0
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/.husky/pre-commit +3 -0
- package/CHANGELOG.md +3 -1
- package/MIGRATION.md +217 -0
- package/README.md +80 -8
- package/README_CN.md +569 -143
- package/SPECIFICATION.md +44 -14
- package/SPECIFICATION.zh-CN.md +44 -14
- package/dist/cjs/binary-tree.cjs +5841 -1678
- package/dist/cjs/graph.cjs +422 -14
- package/dist/cjs/hash.cjs +95 -7
- package/dist/cjs/heap.cjs +174 -16
- package/dist/cjs/index.cjs +7751 -2449
- package/dist/cjs/linked-list.cjs +443 -2
- package/dist/cjs/matrix.cjs +56 -0
- package/dist/cjs/priority-queue.cjs +172 -14
- package/dist/cjs/queue.cjs +435 -0
- package/dist/cjs/stack.cjs +103 -4
- package/dist/cjs/trie.cjs +106 -0
- package/dist/cjs-legacy/binary-tree.cjs +5933 -1772
- package/dist/cjs-legacy/graph.cjs +422 -14
- package/dist/cjs-legacy/hash.cjs +95 -7
- package/dist/cjs-legacy/heap.cjs +174 -16
- package/dist/cjs-legacy/index.cjs +8154 -2854
- package/dist/cjs-legacy/linked-list.cjs +443 -2
- package/dist/cjs-legacy/matrix.cjs +56 -0
- package/dist/cjs-legacy/priority-queue.cjs +172 -14
- package/dist/cjs-legacy/queue.cjs +435 -0
- package/dist/cjs-legacy/stack.cjs +103 -4
- package/dist/cjs-legacy/trie.cjs +106 -0
- package/dist/esm/binary-tree.mjs +5841 -1678
- package/dist/esm/graph.mjs +422 -14
- package/dist/esm/hash.mjs +95 -7
- package/dist/esm/heap.mjs +174 -16
- package/dist/esm/index.mjs +7751 -2449
- package/dist/esm/linked-list.mjs +443 -2
- package/dist/esm/matrix.mjs +56 -0
- package/dist/esm/priority-queue.mjs +172 -14
- package/dist/esm/queue.mjs +435 -0
- package/dist/esm/stack.mjs +103 -4
- package/dist/esm/trie.mjs +106 -0
- package/dist/esm-legacy/binary-tree.mjs +5933 -1772
- package/dist/esm-legacy/graph.mjs +422 -14
- package/dist/esm-legacy/hash.mjs +95 -7
- package/dist/esm-legacy/heap.mjs +174 -16
- package/dist/esm-legacy/index.mjs +8154 -2854
- package/dist/esm-legacy/linked-list.mjs +443 -2
- package/dist/esm-legacy/matrix.mjs +56 -0
- package/dist/esm-legacy/priority-queue.mjs +172 -14
- package/dist/esm-legacy/queue.mjs +435 -0
- package/dist/esm-legacy/stack.mjs +103 -4
- package/dist/esm-legacy/trie.mjs +106 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +86 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +98 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +191 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +171 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +136 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +1061 -167
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1232 -355
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +916 -194
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +1078 -141
- package/dist/types/data-structures/graph/directed-graph.d.ts +70 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +63 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +84 -6
- package/dist/types/data-structures/heap/heap.d.ts +140 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +150 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +106 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +126 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +56 -0
- package/dist/types/data-structures/queue/deque.d.ts +171 -0
- package/dist/types/data-structures/queue/queue.d.ts +97 -0
- package/dist/types/data-structures/stack/stack.d.ts +72 -2
- package/dist/types/data-structures/trie/trie.d.ts +84 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/data-structure-typed.js +7784 -2484
- package/dist/umd/data-structure-typed.min.js +4 -4
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +188 -200
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +62 -62
- package/docs-site-docusaurus/docs/api/classes/BST.md +183 -195
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +143 -155
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +99 -85
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +100 -70
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +38 -38
- package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +48 -48
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +52 -52
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +46 -42
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
- package/docs-site-docusaurus/docs/api/classes/Queue.md +111 -59
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +200 -212
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +75 -75
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +37 -37
- package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +107 -36
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +106 -35
- package/docs-site-docusaurus/docs/api/classes/Trie.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +72 -72
- package/docs-site-docusaurus/docs/guide/architecture.md +75 -7
- package/docs-site-docusaurus/docs/guide/concepts.md +53 -34
- package/docs-site-docusaurus/docs/guide/faq.md +53 -0
- package/docs-site-docusaurus/docs/guide/guides.md +8 -9
- package/docs-site-docusaurus/docs/guide/integrations.md +74 -177
- package/docs-site-docusaurus/docs/guide/overview.md +131 -17
- package/docs-site-docusaurus/src/pages/index.tsx +4 -0
- package/docs-site-docusaurus/typedoc.json +1 -0
- package/jest.integration.config.js +1 -2
- package/package.json +10 -7
- package/src/data-structures/base/iterable-element-base.ts +32 -0
- package/src/data-structures/base/linear-base.ts +11 -0
- package/src/data-structures/binary-tree/avl-tree.ts +88 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +98 -0
- package/src/data-structures/binary-tree/binary-tree.ts +242 -81
- package/src/data-structures/binary-tree/bst.ts +173 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +139 -15
- package/src/data-structures/binary-tree/segment-tree.ts +42 -0
- package/src/data-structures/binary-tree/tree-map.ts +948 -36
- package/src/data-structures/binary-tree/tree-multi-map.ts +893 -13
- package/src/data-structures/binary-tree/tree-multi-set.ts +761 -33
- package/src/data-structures/binary-tree/tree-set.ts +1260 -251
- package/src/data-structures/graph/directed-graph.ts +71 -1
- package/src/data-structures/graph/undirected-graph.ts +64 -1
- package/src/data-structures/hash/hash-map.ts +100 -12
- package/src/data-structures/heap/heap.ts +149 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +178 -2
- package/src/data-structures/linked-list/singly-linked-list.ts +106 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +126 -0
- package/src/data-structures/matrix/matrix.ts +56 -0
- package/src/data-structures/queue/deque.ts +187 -0
- package/src/data-structures/queue/queue.ts +109 -0
- package/src/data-structures/stack/stack.ts +75 -5
- package/src/data-structures/trie/trie.ts +84 -0
- package/src/interfaces/binary-tree.ts +1 -9
- package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
- package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
- package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
|
@@ -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:118](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/graph/directed-graph.ts:118](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L118)
|
|
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:132](https://github.com/zrwusa/data-structure-typed/blob/
|
|
150
|
+
Defined in: [data-structures/graph/directed-graph.ts:132](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L132)
|
|
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:89](https://github.com/zrwusa/data-structure-typed/blob/
|
|
184
|
+
Defined in: [data-structures/graph/abstract-graph.ts:89](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L89)
|
|
185
185
|
|
|
186
186
|
Total number of entries.
|
|
187
187
|
|
|
@@ -207,7 +207,7 @@ Entry count.
|
|
|
207
207
|
iterator: IterableIterator<[VertexKey, V | undefined]>;
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:22](https://github.com/zrwusa/data-structure-typed/blob/
|
|
210
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:22](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L22)
|
|
211
211
|
|
|
212
212
|
Default iterator yielding `[key, value]` entries.
|
|
213
213
|
|
|
@@ -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:254](https://github.com/zrwusa/data-structure-typed/blob/
|
|
266
|
+
Defined in: [data-structures/graph/abstract-graph.ts:254](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L254)
|
|
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:256](https://github.com/zrwusa/data-structure-typed/blob/
|
|
292
|
+
Defined in: [data-structures/graph/abstract-graph.ts:256](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L256)
|
|
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:189](https://github.com/zrwusa/data-structure-typed/blob/
|
|
344
|
+
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)
|
|
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:191](https://github.com/zrwusa/data-structure-typed/blob/
|
|
372
|
+
Defined in: [data-structures/graph/abstract-graph.ts:191](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L191)
|
|
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:705](https://github.com/zrwusa/data-structure-typed/blob/
|
|
410
|
+
Defined in: [data-structures/graph/abstract-graph.ts:705](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L705)
|
|
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:944](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L944)
|
|
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:955](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L955)
|
|
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:210](https://github.com/zrwusa/data-structure-typed/blob/
|
|
564
|
+
Defined in: [data-structures/graph/directed-graph.ts:210](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L210)
|
|
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:197](https://github.com/zrwusa/data-structure-typed/blob/
|
|
622
|
+
Defined in: [data-structures/graph/directed-graph.ts:197](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L197)
|
|
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:626](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L626)
|
|
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:381](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L381)
|
|
709
709
|
|
|
710
710
|
Delete an edge by instance or by `(srcKey, destKey)`.
|
|
711
711
|
|
|
@@ -782,7 +782,7 @@ IGraph.deleteEdge
|
|
|
782
782
|
deleteEdgeSrcToDest(srcOrKey, destOrKey): EO | undefined;
|
|
783
783
|
```
|
|
784
784
|
|
|
785
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
785
|
+
Defined in: [data-structures/graph/directed-graph.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L290)
|
|
786
786
|
|
|
787
787
|
Delete edge `src -> dest` if present.
|
|
788
788
|
|
|
@@ -818,7 +818,7 @@ Time O(1) avg, Space O(1)
|
|
|
818
818
|
deleteVertex(vertexOrKey): boolean;
|
|
819
819
|
```
|
|
820
820
|
|
|
821
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
821
|
+
Defined in: [data-structures/graph/directed-graph.ts:459](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L459)
|
|
822
822
|
|
|
823
823
|
Remove a vertex
|
|
824
824
|
|
|
@@ -869,7 +869,7 @@ dijkstraWithoutHeap(
|
|
|
869
869
|
genPaths?): DijkstraResult<VO>;
|
|
870
870
|
```
|
|
871
871
|
|
|
872
|
-
Defined in: [data-structures/graph/abstract-graph.ts:484](https://github.com/zrwusa/data-structure-typed/blob/
|
|
872
|
+
Defined in: [data-structures/graph/abstract-graph.ts:484](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L484)
|
|
873
873
|
|
|
874
874
|
Dijkstra without heap (array-based selection).
|
|
875
875
|
|
|
@@ -921,7 +921,7 @@ Time O(V^2 + E), Space O(V + E)
|
|
|
921
921
|
edgeSet(): EO[];
|
|
922
922
|
```
|
|
923
923
|
|
|
924
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
924
|
+
Defined in: [data-structures/graph/directed-graph.ts:839](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L839)
|
|
925
925
|
|
|
926
926
|
Get all edges
|
|
927
927
|
|
|
@@ -960,7 +960,7 @@ IGraph.edgeSet
|
|
|
960
960
|
edgesOf(vertexOrKey): EO[];
|
|
961
961
|
```
|
|
962
962
|
|
|
963
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
963
|
+
Defined in: [data-structures/graph/directed-graph.ts:656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L656)
|
|
964
964
|
|
|
965
965
|
All incident edges of a vertex.
|
|
966
966
|
|
|
@@ -1000,7 +1000,7 @@ IGraph.edgesOf
|
|
|
1000
1000
|
entries(): IterableIterator<[VertexKey, V | undefined]>;
|
|
1001
1001
|
```
|
|
1002
1002
|
|
|
1003
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:31](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1003
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:31](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L31)
|
|
1004
1004
|
|
|
1005
1005
|
Iterate over `[key, value]` pairs (may yield `undefined` values).
|
|
1006
1006
|
|
|
@@ -1026,7 +1026,7 @@ Time O(n), Space O(1)
|
|
|
1026
1026
|
every(predicate, thisArg?): boolean;
|
|
1027
1027
|
```
|
|
1028
1028
|
|
|
1029
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:66](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1029
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:66](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L66)
|
|
1030
1030
|
|
|
1031
1031
|
Test whether all entries satisfy the predicate.
|
|
1032
1032
|
|
|
@@ -1066,7 +1066,7 @@ Time O(n), Space O(1)
|
|
|
1066
1066
|
filter(predicate, thisArg?): this;
|
|
1067
1067
|
```
|
|
1068
1068
|
|
|
1069
|
-
Defined in: [data-structures/graph/abstract-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1069
|
+
Defined in: [data-structures/graph/abstract-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L897)
|
|
1070
1070
|
|
|
1071
1071
|
Induced-subgraph filter: keep vertices where `predicate(key, value)` is true,
|
|
1072
1072
|
and only keep edges whose endpoints both survive.
|
|
@@ -1113,7 +1113,7 @@ IGraph.filter
|
|
|
1113
1113
|
filterEntries(predicate, thisArg?): [VertexKey, V | undefined][];
|
|
1114
1114
|
```
|
|
1115
1115
|
|
|
1116
|
-
Defined in: [data-structures/graph/abstract-graph.ts:913](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1116
|
+
Defined in: [data-structures/graph/abstract-graph.ts:913](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L913)
|
|
1117
1117
|
|
|
1118
1118
|
Preserve the old behavior: return filtered entries as an array.
|
|
1119
1119
|
|
|
@@ -1147,7 +1147,7 @@ Time O(V), Space O(V)
|
|
|
1147
1147
|
find(callbackfn, thisArg?): [VertexKey, V | undefined] | undefined;
|
|
1148
1148
|
```
|
|
1149
1149
|
|
|
1150
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:114](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1150
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:114](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L114)
|
|
1151
1151
|
|
|
1152
1152
|
Find the first entry that matches a predicate.
|
|
1153
1153
|
|
|
@@ -1187,7 +1187,7 @@ Time O(n), Space O(1)
|
|
|
1187
1187
|
floydWarshall(): object;
|
|
1188
1188
|
```
|
|
1189
1189
|
|
|
1190
|
-
Defined in: [data-structures/graph/abstract-graph.ts:798](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1190
|
+
Defined in: [data-structures/graph/abstract-graph.ts:798](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L798)
|
|
1191
1191
|
|
|
1192
1192
|
Floyd–Warshall all-pairs shortest paths.
|
|
1193
1193
|
|
|
@@ -1225,7 +1225,7 @@ Time O(V^3), Space O(V^2)
|
|
|
1225
1225
|
forEach(callbackfn, thisArg?): void;
|
|
1226
1226
|
```
|
|
1227
1227
|
|
|
1228
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:99](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1228
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:99](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L99)
|
|
1229
1229
|
|
|
1230
1230
|
Visit each entry, left-to-right.
|
|
1231
1231
|
|
|
@@ -1263,7 +1263,7 @@ Time O(n), Space O(1)
|
|
|
1263
1263
|
get(key): V | undefined;
|
|
1264
1264
|
```
|
|
1265
1265
|
|
|
1266
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:156](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1266
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:156](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L156)
|
|
1267
1267
|
|
|
1268
1268
|
Get the value under a key.
|
|
1269
1269
|
|
|
@@ -1300,7 +1300,7 @@ getAllPathsBetween(
|
|
|
1300
1300
|
limit?): VO[][];
|
|
1301
1301
|
```
|
|
1302
1302
|
|
|
1303
|
-
Defined in: [data-structures/graph/abstract-graph.ts:309](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1303
|
+
Defined in: [data-structures/graph/abstract-graph.ts:309](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L309)
|
|
1304
1304
|
|
|
1305
1305
|
Enumerate simple paths up to a limit.
|
|
1306
1306
|
|
|
@@ -1346,7 +1346,7 @@ Time O(paths) worst-case exponential, Space O(V + paths)
|
|
|
1346
1346
|
getCycles(isInclude2Cycle?): VertexKey[][];
|
|
1347
1347
|
```
|
|
1348
1348
|
|
|
1349
|
-
Defined in: [data-structures/graph/abstract-graph.ts:838](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1349
|
+
Defined in: [data-structures/graph/abstract-graph.ts:838](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L838)
|
|
1350
1350
|
|
|
1351
1351
|
Enumerate simple cycles (may be expensive).
|
|
1352
1352
|
|
|
@@ -1380,7 +1380,7 @@ Time exponential in worst-case, Space O(V + E)
|
|
|
1380
1380
|
getDestinations(vertex): VO[];
|
|
1381
1381
|
```
|
|
1382
1382
|
|
|
1383
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1383
|
+
Defined in: [data-structures/graph/directed-graph.ts:674](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L674)
|
|
1384
1384
|
|
|
1385
1385
|
Direct children reachable by one outgoing edge.
|
|
1386
1386
|
|
|
@@ -1410,7 +1410,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
1410
1410
|
getDFNMap(): Map<VO, number>;
|
|
1411
1411
|
```
|
|
1412
1412
|
|
|
1413
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1413
|
+
Defined in: [data-structures/graph/directed-graph.ts:1069](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1069)
|
|
1414
1414
|
|
|
1415
1415
|
DFN index map computed by `tarjan()`.
|
|
1416
1416
|
|
|
@@ -1432,7 +1432,7 @@ Time O(V), Space O(V)
|
|
|
1432
1432
|
getEdge(srcOrKey, destOrKey): EO | undefined;
|
|
1433
1433
|
```
|
|
1434
1434
|
|
|
1435
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1435
|
+
Defined in: [data-structures/graph/directed-graph.ts:265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L265)
|
|
1436
1436
|
|
|
1437
1437
|
Get the unique edge from `src` to `dest`, if present.
|
|
1438
1438
|
|
|
@@ -1492,7 +1492,7 @@ IGraph.getEdge
|
|
|
1492
1492
|
getEndsOfEdge(edge): [VO, VO] | undefined;
|
|
1493
1493
|
```
|
|
1494
1494
|
|
|
1495
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1495
|
+
Defined in: [data-structures/graph/directed-graph.ts:919](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L919)
|
|
1496
1496
|
|
|
1497
1497
|
Resolve an edge's `[src, dest]` endpoints to vertex instances.
|
|
1498
1498
|
|
|
@@ -1532,7 +1532,7 @@ IGraph.getEndsOfEdge
|
|
|
1532
1532
|
getLowMap(): Map<VO, number>;
|
|
1533
1533
|
```
|
|
1534
1534
|
|
|
1535
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1535
|
+
Defined in: [data-structures/graph/directed-graph.ts:1078](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1078)
|
|
1536
1536
|
|
|
1537
1537
|
LOW link map computed by `tarjan()`.
|
|
1538
1538
|
|
|
@@ -1557,7 +1557,7 @@ getMinCostBetween(
|
|
|
1557
1557
|
isWeight?): number | undefined;
|
|
1558
1558
|
```
|
|
1559
1559
|
|
|
1560
|
-
Defined in: [data-structures/graph/abstract-graph.ts:362](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1560
|
+
Defined in: [data-structures/graph/abstract-graph.ts:362](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L362)
|
|
1561
1561
|
|
|
1562
1562
|
Minimum hops/weight between two vertices.
|
|
1563
1563
|
|
|
@@ -1607,7 +1607,7 @@ getMinPathBetween(
|
|
|
1607
1607
|
isDFS?): VO[] | undefined;
|
|
1608
1608
|
```
|
|
1609
1609
|
|
|
1610
|
-
Defined in: [data-structures/graph/abstract-graph.ts:415](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1610
|
+
Defined in: [data-structures/graph/abstract-graph.ts:415](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L415)
|
|
1611
1611
|
|
|
1612
1612
|
Minimum path (as vertex sequence) between two vertices.
|
|
1613
1613
|
|
|
@@ -1659,7 +1659,7 @@ Time O((V + E) log V) weighted / O(V + E) unweighted, Space O(V + E)
|
|
|
1659
1659
|
getNeighbors(vertexOrKey): VO[];
|
|
1660
1660
|
```
|
|
1661
1661
|
|
|
1662
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1662
|
+
Defined in: [data-structures/graph/directed-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L897)
|
|
1663
1663
|
|
|
1664
1664
|
Get outgoing neighbors
|
|
1665
1665
|
|
|
@@ -1707,7 +1707,7 @@ IGraph.getNeighbors
|
|
|
1707
1707
|
getPathSumWeight(path): number;
|
|
1708
1708
|
```
|
|
1709
1709
|
|
|
1710
|
-
Defined in: [data-structures/graph/abstract-graph.ts:346](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1710
|
+
Defined in: [data-structures/graph/abstract-graph.ts:346](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L346)
|
|
1711
1711
|
|
|
1712
1712
|
Sum the weights along a vertex path.
|
|
1713
1713
|
|
|
@@ -1741,7 +1741,7 @@ Time O(L), Space O(1) where L is path length
|
|
|
1741
1741
|
getSCCs(): Map<number, VO[]>;
|
|
1742
1742
|
```
|
|
1743
1743
|
|
|
1744
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1744
|
+
Defined in: [data-structures/graph/directed-graph.ts:1134](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1134)
|
|
1745
1745
|
|
|
1746
1746
|
Strongly connected components computed by `tarjan()`.
|
|
1747
1747
|
|
|
@@ -1780,7 +1780,7 @@ Time O(#SCC + V), Space O(V)
|
|
|
1780
1780
|
getVertex(vertexKey): VO | undefined;
|
|
1781
1781
|
```
|
|
1782
1782
|
|
|
1783
|
-
Defined in: [data-structures/graph/abstract-graph.ts:175](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1783
|
+
Defined in: [data-structures/graph/abstract-graph.ts:175](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L175)
|
|
1784
1784
|
|
|
1785
1785
|
Get vertex instance by key.
|
|
1786
1786
|
|
|
@@ -1820,7 +1820,7 @@ IGraph.getVertex
|
|
|
1820
1820
|
has(key): boolean;
|
|
1821
1821
|
```
|
|
1822
1822
|
|
|
1823
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:129](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1823
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:129](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L129)
|
|
1824
1824
|
|
|
1825
1825
|
Whether the given key exists.
|
|
1826
1826
|
|
|
@@ -1854,7 +1854,7 @@ Time O(n) generic, Space O(1)
|
|
|
1854
1854
|
hasEdge(v1, v2): boolean;
|
|
1855
1855
|
```
|
|
1856
1856
|
|
|
1857
|
-
Defined in: [data-structures/graph/abstract-graph.ts:249](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1857
|
+
Defined in: [data-structures/graph/abstract-graph.ts:249](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L249)
|
|
1858
1858
|
|
|
1859
1859
|
Whether an edge exists between two vertices.
|
|
1860
1860
|
|
|
@@ -1894,7 +1894,7 @@ Time O(1) avg, Space O(1)
|
|
|
1894
1894
|
hasValue(value): boolean;
|
|
1895
1895
|
```
|
|
1896
1896
|
|
|
1897
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:143](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1897
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:143](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L143)
|
|
1898
1898
|
|
|
1899
1899
|
Whether there exists an entry with the given value.
|
|
1900
1900
|
|
|
@@ -1928,7 +1928,7 @@ Time O(n), Space O(1)
|
|
|
1928
1928
|
hasVertex(vertexOrKey): boolean;
|
|
1929
1929
|
```
|
|
1930
1930
|
|
|
1931
|
-
Defined in: [data-structures/graph/abstract-graph.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1931
|
+
Defined in: [data-structures/graph/abstract-graph.ts:185](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L185)
|
|
1932
1932
|
|
|
1933
1933
|
Whether a vertex exists.
|
|
1934
1934
|
|
|
@@ -1968,7 +1968,7 @@ IGraph.hasVertex
|
|
|
1968
1968
|
incomingEdgesOf(vertexOrKey): EO[];
|
|
1969
1969
|
```
|
|
1970
1970
|
|
|
1971
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1971
|
+
Defined in: [data-structures/graph/directed-graph.ts:553](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L553)
|
|
1972
1972
|
|
|
1973
1973
|
Incoming edges of a vertex.
|
|
1974
1974
|
|
|
@@ -2013,7 +2013,7 @@ Time O(deg_in), Space O(deg_in)
|
|
|
2013
2013
|
isEmpty(): boolean;
|
|
2014
2014
|
```
|
|
2015
2015
|
|
|
2016
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2016
|
+
Defined in: [data-structures/graph/directed-graph.ts:936](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L936)
|
|
2017
2017
|
|
|
2018
2018
|
Whether the graph has no vertices and no edges.
|
|
2019
2019
|
|
|
@@ -2043,7 +2043,7 @@ IGraph.isEmpty
|
|
|
2043
2043
|
isVertexKey(potentialKey): potentialKey is VertexKey;
|
|
2044
2044
|
```
|
|
2045
2045
|
|
|
2046
|
-
Defined in: [data-structures/graph/abstract-graph.ts:215](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2046
|
+
Defined in: [data-structures/graph/abstract-graph.ts:215](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L215)
|
|
2047
2047
|
|
|
2048
2048
|
Type guard: check if a value is a valid vertex key.
|
|
2049
2049
|
|
|
@@ -2077,7 +2077,7 @@ Time O(1), Space O(1)
|
|
|
2077
2077
|
keys(): IterableIterator<VertexKey>;
|
|
2078
2078
|
```
|
|
2079
2079
|
|
|
2080
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:42](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2080
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:42](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L42)
|
|
2081
2081
|
|
|
2082
2082
|
Iterate over keys only.
|
|
2083
2083
|
|
|
@@ -2103,7 +2103,7 @@ Time O(n), Space O(1)
|
|
|
2103
2103
|
map<T>(callback, thisArg?): T[];
|
|
2104
2104
|
```
|
|
2105
2105
|
|
|
2106
|
-
Defined in: [data-structures/graph/abstract-graph.ts:928](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2106
|
+
Defined in: [data-structures/graph/abstract-graph.ts:928](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L928)
|
|
2107
2107
|
|
|
2108
2108
|
Map entries using an implementation-specific strategy.
|
|
2109
2109
|
|
|
@@ -2143,7 +2143,7 @@ Time O(n), Space O(n)
|
|
|
2143
2143
|
outgoingEdgesOf(vertexOrKey): EO[];
|
|
2144
2144
|
```
|
|
2145
2145
|
|
|
2146
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2146
|
+
Defined in: [data-structures/graph/directed-graph.ts:612](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L612)
|
|
2147
2147
|
|
|
2148
2148
|
Outgoing edges of a vertex.
|
|
2149
2149
|
|
|
@@ -2188,7 +2188,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
2188
2188
|
print(options?): void;
|
|
2189
2189
|
```
|
|
2190
2190
|
|
|
2191
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1183](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2191
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1183](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1183)
|
|
2192
2192
|
|
|
2193
2193
|
Print the graph to console.
|
|
2194
2194
|
|
|
@@ -2218,7 +2218,7 @@ Display settings passed to `toVisual`.
|
|
|
2218
2218
|
reduce<U>(callbackfn, initialValue): U;
|
|
2219
2219
|
```
|
|
2220
2220
|
|
|
2221
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:171](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2221
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:171](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L171)
|
|
2222
2222
|
|
|
2223
2223
|
Reduce entries into a single accumulator.
|
|
2224
2224
|
|
|
@@ -2264,7 +2264,7 @@ Time O(n), Space O(1)
|
|
|
2264
2264
|
removeManyVertices(vertexMap): boolean;
|
|
2265
2265
|
```
|
|
2266
2266
|
|
|
2267
|
-
Defined in: [data-structures/graph/abstract-graph.ts:234](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2267
|
+
Defined in: [data-structures/graph/abstract-graph.ts:234](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L234)
|
|
2268
2268
|
|
|
2269
2269
|
Delete multiple vertices.
|
|
2270
2270
|
|
|
@@ -2301,7 +2301,7 @@ setEdgeWeight(
|
|
|
2301
2301
|
weight): boolean;
|
|
2302
2302
|
```
|
|
2303
2303
|
|
|
2304
|
-
Defined in: [data-structures/graph/abstract-graph.ts:291](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2304
|
+
Defined in: [data-structures/graph/abstract-graph.ts:291](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L291)
|
|
2305
2305
|
|
|
2306
2306
|
Set the weight of an existing edge.
|
|
2307
2307
|
|
|
@@ -2347,7 +2347,7 @@ Time O(1) avg, Space O(1)
|
|
|
2347
2347
|
some(predicate, thisArg?): boolean;
|
|
2348
2348
|
```
|
|
2349
2349
|
|
|
2350
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:83](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2350
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:83](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L83)
|
|
2351
2351
|
|
|
2352
2352
|
Test whether any entry satisfies the predicate.
|
|
2353
2353
|
|
|
@@ -2387,7 +2387,7 @@ Time O(n), Space O(1)
|
|
|
2387
2387
|
tarjan(): object;
|
|
2388
2388
|
```
|
|
2389
2389
|
|
|
2390
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2390
|
+
Defined in: [data-structures/graph/directed-graph.ts:1013](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1013)
|
|
2391
2391
|
|
|
2392
2392
|
Tarjan's algorithm for strongly connected components.
|
|
2393
2393
|
|
|
@@ -2446,7 +2446,7 @@ Time O(V + E), Space O(V + E)
|
|
|
2446
2446
|
toArray(): [VertexKey, V | undefined][];
|
|
2447
2447
|
```
|
|
2448
2448
|
|
|
2449
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:186](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2449
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:186](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L186)
|
|
2450
2450
|
|
|
2451
2451
|
Converts data structure to `[key, value]` pairs.
|
|
2452
2452
|
|
|
@@ -2472,7 +2472,7 @@ Time O(n), Space O(n)
|
|
|
2472
2472
|
toDot(options?): string;
|
|
2473
2473
|
```
|
|
2474
2474
|
|
|
2475
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1143](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2475
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1143](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1143)
|
|
2476
2476
|
|
|
2477
2477
|
Generate DOT language representation for Graphviz.
|
|
2478
2478
|
|
|
@@ -2512,7 +2512,7 @@ DOT format string.
|
|
|
2512
2512
|
topologicalSort(propertyName?): (VertexKey | VO)[] | undefined;
|
|
2513
2513
|
```
|
|
2514
2514
|
|
|
2515
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2515
|
+
Defined in: [data-structures/graph/directed-graph.ts:756](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L756)
|
|
2516
2516
|
|
|
2517
2517
|
Topological sort if DAG; returns `undefined` if a cycle exists.
|
|
2518
2518
|
|
|
@@ -2570,7 +2570,7 @@ Time O(V + E), Space O(V)
|
|
|
2570
2570
|
toVisual(options?): string;
|
|
2571
2571
|
```
|
|
2572
2572
|
|
|
2573
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1108](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2573
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1108](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1108)
|
|
2574
2574
|
|
|
2575
2575
|
Generate a text-based visual representation of the graph.
|
|
2576
2576
|
|
|
@@ -2614,7 +2614,7 @@ The visual string.
|
|
|
2614
2614
|
values(): IterableIterator<V | undefined>;
|
|
2615
2615
|
```
|
|
2616
2616
|
|
|
2617
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:53](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2617
|
+
Defined in: [data-structures/base/iterable-entry-base.ts:53](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/base/iterable-entry-base.ts#L53)
|
|
2618
2618
|
|
|
2619
2619
|
Iterate over values only.
|
|
2620
2620
|
|
|
@@ -2640,7 +2640,7 @@ Time O(n), Space O(1)
|
|
|
2640
2640
|
static fromEntries<V>(entries): DirectedGraph<V, undefined, DirectedVertex<V>, DirectedEdge<undefined>>;
|
|
2641
2641
|
```
|
|
2642
2642
|
|
|
2643
|
-
Defined in: [data-structures/graph/directed-graph.ts:182](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2643
|
+
Defined in: [data-structures/graph/directed-graph.ts:182](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L182)
|
|
2644
2644
|
|
|
2645
2645
|
Construct a directed graph from `[key, value]` entries.
|
|
2646
2646
|
|
|
@@ -2678,7 +2678,7 @@ Time O(V), Space O(V)
|
|
|
2678
2678
|
static fromKeys<K>(keys): DirectedGraph<K, undefined, DirectedVertex<K>, DirectedEdge<undefined>>;
|
|
2679
2679
|
```
|
|
2680
2680
|
|
|
2681
|
-
Defined in: [data-structures/graph/directed-graph.ts:167](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2681
|
+
Defined in: [data-structures/graph/directed-graph.ts:167](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L167)
|
|
2682
2682
|
|
|
2683
2683
|
Construct a directed graph from keys with value initializer `v => v`.
|
|
2684
2684
|
|
|
@@ -2721,7 +2721,7 @@ Time O(V), Space O(V)
|
|
|
2721
2721
|
get protected _edgeConnector(): string;
|
|
2722
2722
|
```
|
|
2723
2723
|
|
|
2724
|
-
Defined in: [data-structures/graph/directed-graph.ts:136](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2724
|
+
Defined in: [data-structures/graph/directed-graph.ts:136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L136)
|
|
2725
2725
|
|
|
2726
2726
|
The edge connector string used in visual output.
|
|
2727
2727
|
Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
@@ -2742,7 +2742,7 @@ Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
|
2742
2742
|
protected _addEdge(edge): boolean;
|
|
2743
2743
|
```
|
|
2744
2744
|
|
|
2745
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2745
|
+
Defined in: [data-structures/graph/directed-graph.ts:1144](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1144)
|
|
2746
2746
|
|
|
2747
2747
|
Internal hook to attach a directed edge into adjacency maps.
|
|
2748
2748
|
|
|
@@ -2776,7 +2776,7 @@ Time O(1) avg, Space O(1)
|
|
|
2776
2776
|
protected _addVertex(newVertex): boolean;
|
|
2777
2777
|
```
|
|
2778
2778
|
|
|
2779
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1054](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2779
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1054](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1054)
|
|
2780
2780
|
|
|
2781
2781
|
Insert a pre-built vertex into the graph.
|
|
2782
2782
|
|
|
@@ -2810,7 +2810,7 @@ Time O(1) avg, Space O(1)
|
|
|
2810
2810
|
protected _createInstance(_options?): this;
|
|
2811
2811
|
```
|
|
2812
2812
|
|
|
2813
|
-
Defined in: [data-structures/graph/abstract-graph.ts:987](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2813
|
+
Defined in: [data-structures/graph/abstract-graph.ts:987](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L987)
|
|
2814
2814
|
|
|
2815
2815
|
Create an empty graph instance of the same concrete species.
|
|
2816
2816
|
|
|
@@ -2844,7 +2844,7 @@ Time O(1), Space O(1)
|
|
|
2844
2844
|
protected _createLike(iter?, options?): this;
|
|
2845
2845
|
```
|
|
2846
2846
|
|
|
2847
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1009](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2847
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1009](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1009)
|
|
2848
2848
|
|
|
2849
2849
|
Create a same-species graph populated with entries; preserves edges among kept vertices.
|
|
2850
2850
|
|
|
@@ -2884,7 +2884,7 @@ Time O(V + E), Space O(V + E)
|
|
|
2884
2884
|
protected _getIterator(): IterableIterator<[VertexKey, V | undefined]>;
|
|
2885
2885
|
```
|
|
2886
2886
|
|
|
2887
|
-
Defined in: [data-structures/graph/abstract-graph.ts:958](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2887
|
+
Defined in: [data-structures/graph/abstract-graph.ts:958](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L958)
|
|
2888
2888
|
|
|
2889
2889
|
Internal iterator over `[key, value]` entries in insertion order.
|
|
2890
2890
|
|
|
@@ -2910,7 +2910,7 @@ Time O(V), Space O(1)
|
|
|
2910
2910
|
protected _getVertex(vertexOrKey): VO | undefined;
|
|
2911
2911
|
```
|
|
2912
2912
|
|
|
2913
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1068](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2913
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1068](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1068)
|
|
2914
2914
|
|
|
2915
2915
|
Resolve a vertex key or instance to the concrete vertex instance.
|
|
2916
2916
|
|
|
@@ -2944,7 +2944,7 @@ Time O(1), Space O(1)
|
|
|
2944
2944
|
protected _getVertexKey(vertexOrKey): VertexKey;
|
|
2945
2945
|
```
|
|
2946
2946
|
|
|
2947
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1079](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2947
|
+
Defined in: [data-structures/graph/abstract-graph.ts:1079](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L1079)
|
|
2948
2948
|
|
|
2949
2949
|
Resolve a vertex key from a key or vertex instance.
|
|
2950
2950
|
|
|
@@ -2978,7 +2978,7 @@ Time O(1), Space O(1)
|
|
|
2978
2978
|
protected _snapshotOptions(): Record<string, unknown>;
|
|
2979
2979
|
```
|
|
2980
2980
|
|
|
2981
|
-
Defined in: [data-structures/graph/abstract-graph.ts:973](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2981
|
+
Defined in: [data-structures/graph/abstract-graph.ts:973](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/abstract-graph.ts#L973)
|
|
2982
2982
|
|
|
2983
2983
|
Capture configuration needed to reproduce the current graph.
|
|
2984
2984
|
|