data-structure-typed 2.5.2 → 2.5.3
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/CHANGELOG.md +3 -1
- package/MIGRATION.md +169 -0
- package/README.md +60 -6
- package/README_CN.md +551 -143
- package/SPECIFICATION.md +20 -14
- package/SPECIFICATION.zh-CN.md +20 -14
- package/dist/cjs/binary-tree.cjs +2417 -132
- package/dist/cjs/graph.cjs +248 -14
- package/dist/cjs/hash.cjs +62 -7
- package/dist/cjs/heap.cjs +103 -16
- package/dist/cjs/index.cjs +3046 -124
- package/dist/cjs/linked-list.cjs +219 -0
- package/dist/cjs/matrix.cjs +32 -0
- package/dist/cjs/priority-queue.cjs +101 -14
- package/dist/cjs/queue.cjs +215 -0
- package/dist/cjs/stack.cjs +44 -4
- package/dist/cjs/trie.cjs +44 -0
- package/dist/cjs-legacy/binary-tree.cjs +2406 -123
- package/dist/cjs-legacy/graph.cjs +248 -14
- package/dist/cjs-legacy/hash.cjs +62 -7
- package/dist/cjs-legacy/heap.cjs +103 -16
- package/dist/cjs-legacy/index.cjs +3105 -185
- package/dist/cjs-legacy/linked-list.cjs +219 -0
- package/dist/cjs-legacy/matrix.cjs +32 -0
- package/dist/cjs-legacy/priority-queue.cjs +101 -14
- package/dist/cjs-legacy/queue.cjs +215 -0
- package/dist/cjs-legacy/stack.cjs +44 -4
- package/dist/cjs-legacy/trie.cjs +44 -0
- package/dist/esm/binary-tree.mjs +2417 -132
- package/dist/esm/graph.mjs +248 -14
- package/dist/esm/hash.mjs +62 -7
- package/dist/esm/heap.mjs +103 -16
- package/dist/esm/index.mjs +3046 -124
- package/dist/esm/linked-list.mjs +219 -0
- package/dist/esm/matrix.mjs +32 -0
- package/dist/esm/priority-queue.mjs +101 -14
- package/dist/esm/queue.mjs +215 -0
- package/dist/esm/stack.mjs +44 -4
- package/dist/esm/trie.mjs +44 -0
- package/dist/esm-legacy/binary-tree.mjs +2406 -123
- package/dist/esm-legacy/graph.mjs +248 -14
- package/dist/esm-legacy/hash.mjs +62 -7
- package/dist/esm-legacy/heap.mjs +103 -16
- package/dist/esm-legacy/index.mjs +3105 -185
- package/dist/esm-legacy/linked-list.mjs +219 -0
- package/dist/esm-legacy/matrix.mjs +32 -0
- package/dist/esm-legacy/priority-queue.mjs +101 -14
- package/dist/esm-legacy/queue.mjs +215 -0
- package/dist/esm-legacy/stack.mjs +44 -4
- package/dist/esm-legacy/trie.mjs +44 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +50 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +116 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +99 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +79 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +520 -1
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +489 -1
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +393 -1
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +500 -1
- package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +51 -6
- package/dist/types/data-structures/heap/heap.d.ts +98 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +61 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
- package/dist/types/data-structures/queue/deque.d.ts +82 -0
- package/dist/types/data-structures/queue/queue.d.ts +61 -0
- package/dist/types/data-structures/stack/stack.d.ts +42 -2
- package/dist/types/data-structures/trie/trie.d.ts +48 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/data-structure-typed.js +3105 -185
- 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 +42 -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/package.json +7 -6
- package/src/data-structures/binary-tree/avl-tree.ts +52 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +56 -0
- package/src/data-structures/binary-tree/binary-tree.ts +167 -81
- package/src/data-structures/binary-tree/bst.ts +101 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +82 -15
- package/src/data-structures/binary-tree/segment-tree.ts +24 -0
- package/src/data-structures/binary-tree/tree-map.ts +540 -3
- package/src/data-structures/binary-tree/tree-multi-map.ts +490 -2
- package/src/data-structures/binary-tree/tree-multi-set.ts +393 -1
- package/src/data-structures/binary-tree/tree-set.ts +520 -3
- package/src/data-structures/graph/directed-graph.ts +41 -1
- package/src/data-structures/graph/undirected-graph.ts +37 -1
- package/src/data-structures/hash/hash-map.ts +67 -12
- package/src/data-structures/heap/heap.ts +107 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +88 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +61 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +72 -0
- package/src/data-structures/matrix/matrix.ts +32 -0
- package/src/data-structures/queue/deque.ts +85 -0
- package/src/data-structures/queue/queue.ts +73 -0
- package/src/data-structures/stack/stack.ts +45 -5
- package/src/data-structures/trie/trie.ts +48 -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: MapGraph\<V, E, VO, EO\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/graph/map-graph.ts:96](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/graph/map-graph.ts:96](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L96)
|
|
10
10
|
|
|
11
11
|
Directed graph variant carrying geospatial coordinates.
|
|
12
12
|
|
|
@@ -119,7 +119,7 @@ Concrete edge class (MapEdge<E>).
|
|
|
119
119
|
new MapGraph<V, E, VO, EO>(originCoord, bottomRight?): MapGraph<V, E, VO, EO>;
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
Defined in: [data-structures/graph/map-graph.ts:108](https://github.com/zrwusa/data-structure-typed/blob/
|
|
122
|
+
Defined in: [data-structures/graph/map-graph.ts:108](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L108)
|
|
123
123
|
|
|
124
124
|
Construct a MapGraph.
|
|
125
125
|
|
|
@@ -159,7 +159,7 @@ Time O(1), Space O(1)
|
|
|
159
159
|
get size(): number;
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
Defined in: [data-structures/graph/abstract-graph.ts:89](https://github.com/zrwusa/data-structure-typed/blob/
|
|
162
|
+
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)
|
|
163
163
|
|
|
164
164
|
Total number of entries.
|
|
165
165
|
|
|
@@ -185,7 +185,7 @@ Entry count.
|
|
|
185
185
|
iterator: IterableIterator<[VertexKey, V | undefined]>;
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:22](https://github.com/zrwusa/data-structure-typed/blob/
|
|
188
|
+
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)
|
|
189
189
|
|
|
190
190
|
Default iterator yielding `[key, value]` entries.
|
|
191
191
|
|
|
@@ -241,7 +241,7 @@ Time O(1) avg, Space O(1)
|
|
|
241
241
|
addEdge(edge): boolean;
|
|
242
242
|
```
|
|
243
243
|
|
|
244
|
-
Defined in: [data-structures/graph/abstract-graph.ts:254](https://github.com/zrwusa/data-structure-typed/blob/
|
|
244
|
+
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)
|
|
245
245
|
|
|
246
246
|
##### Parameters
|
|
247
247
|
|
|
@@ -267,7 +267,7 @@ addEdge(
|
|
|
267
267
|
value?): boolean;
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
Defined in: [data-structures/graph/abstract-graph.ts:256](https://github.com/zrwusa/data-structure-typed/blob/
|
|
270
|
+
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)
|
|
271
271
|
|
|
272
272
|
##### Parameters
|
|
273
273
|
|
|
@@ -319,7 +319,7 @@ Time O(1) avg, Space O(1)
|
|
|
319
319
|
addVertex(vertex): boolean;
|
|
320
320
|
```
|
|
321
321
|
|
|
322
|
-
Defined in: [data-structures/graph/abstract-graph.ts:189](https://github.com/zrwusa/data-structure-typed/blob/
|
|
322
|
+
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)
|
|
323
323
|
|
|
324
324
|
##### Parameters
|
|
325
325
|
|
|
@@ -341,7 +341,7 @@ Defined in: [data-structures/graph/abstract-graph.ts:189](https://github.com/zrw
|
|
|
341
341
|
addVertex(key, value?): boolean;
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
Defined in: [data-structures/graph/abstract-graph.ts:191](https://github.com/zrwusa/data-structure-typed/blob/
|
|
344
|
+
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)
|
|
345
345
|
|
|
346
346
|
##### Parameters
|
|
347
347
|
|
|
@@ -373,7 +373,7 @@ bellmanFord(
|
|
|
373
373
|
genPath?): object;
|
|
374
374
|
```
|
|
375
375
|
|
|
376
|
-
Defined in: [data-structures/graph/abstract-graph.ts:705](https://github.com/zrwusa/data-structure-typed/blob/
|
|
376
|
+
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)
|
|
377
377
|
|
|
378
378
|
Bellman-Ford single-source shortest paths with option to scan negative cycles.
|
|
379
379
|
|
|
@@ -461,7 +461,7 @@ Time O(V * E), Space O(V + E)
|
|
|
461
461
|
clear(): void;
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
464
|
+
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)
|
|
465
465
|
|
|
466
466
|
Remove all vertices and edges.
|
|
467
467
|
|
|
@@ -485,7 +485,7 @@ Time O(V + E), Space O(1)
|
|
|
485
485
|
clone(): this;
|
|
486
486
|
```
|
|
487
487
|
|
|
488
|
-
Defined in: [data-structures/graph/map-graph.ts:162](https://github.com/zrwusa/data-structure-typed/blob/
|
|
488
|
+
Defined in: [data-structures/graph/map-graph.ts:162](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L162)
|
|
489
489
|
|
|
490
490
|
Deep clone as the same concrete class.
|
|
491
491
|
|
|
@@ -515,7 +515,7 @@ createEdge(
|
|
|
515
515
|
value?): EO;
|
|
516
516
|
```
|
|
517
517
|
|
|
518
|
-
Defined in: [data-structures/graph/map-graph.ts:153](https://github.com/zrwusa/data-structure-typed/blob/
|
|
518
|
+
Defined in: [data-structures/graph/map-graph.ts:153](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L153)
|
|
519
519
|
|
|
520
520
|
Create a map edge (directed) with optional weight/value.
|
|
521
521
|
|
|
@@ -571,7 +571,7 @@ createVertex(
|
|
|
571
571
|
long?): VO;
|
|
572
572
|
```
|
|
573
573
|
|
|
574
|
-
Defined in: [data-structures/graph/map-graph.ts:135](https://github.com/zrwusa/data-structure-typed/blob/
|
|
574
|
+
Defined in: [data-structures/graph/map-graph.ts:135](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L135)
|
|
575
575
|
|
|
576
576
|
Create a map vertex with optional coordinates.
|
|
577
577
|
|
|
@@ -623,7 +623,7 @@ Time O(1), Space O(1)
|
|
|
623
623
|
degreeOf(vertexOrKey): number;
|
|
624
624
|
```
|
|
625
625
|
|
|
626
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
626
|
+
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)
|
|
627
627
|
|
|
628
628
|
Degree (in + out) of a vertex.
|
|
629
629
|
|
|
@@ -657,7 +657,7 @@ Time O(1) avg, Space O(1)
|
|
|
657
657
|
deleteEdge(edgeOrSrcVertexKey, destVertexKey?): EO | undefined;
|
|
658
658
|
```
|
|
659
659
|
|
|
660
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
660
|
+
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)
|
|
661
661
|
|
|
662
662
|
Delete an edge by instance or by `(srcKey, destKey)`.
|
|
663
663
|
|
|
@@ -728,7 +728,7 @@ Time O(1) avg, Space O(1)
|
|
|
728
728
|
deleteEdgeSrcToDest(srcOrKey, destOrKey): EO | undefined;
|
|
729
729
|
```
|
|
730
730
|
|
|
731
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
731
|
+
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)
|
|
732
732
|
|
|
733
733
|
Delete edge `src -> dest` if present.
|
|
734
734
|
|
|
@@ -768,7 +768,7 @@ Time O(1) avg, Space O(1)
|
|
|
768
768
|
deleteVertex(vertexOrKey): boolean;
|
|
769
769
|
```
|
|
770
770
|
|
|
771
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
771
|
+
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)
|
|
772
772
|
|
|
773
773
|
Remove a vertex
|
|
774
774
|
|
|
@@ -813,7 +813,7 @@ dijkstraWithoutHeap(
|
|
|
813
813
|
genPaths?): DijkstraResult<VO>;
|
|
814
814
|
```
|
|
815
815
|
|
|
816
|
-
Defined in: [data-structures/graph/abstract-graph.ts:484](https://github.com/zrwusa/data-structure-typed/blob/
|
|
816
|
+
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)
|
|
817
817
|
|
|
818
818
|
Dijkstra without heap (array-based selection).
|
|
819
819
|
|
|
@@ -865,7 +865,7 @@ Time O(V^2 + E), Space O(V + E)
|
|
|
865
865
|
edgeSet(): EO[];
|
|
866
866
|
```
|
|
867
867
|
|
|
868
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
868
|
+
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)
|
|
869
869
|
|
|
870
870
|
Get all edges
|
|
871
871
|
|
|
@@ -898,7 +898,7 @@ Get all edges
|
|
|
898
898
|
edgesOf(vertexOrKey): EO[];
|
|
899
899
|
```
|
|
900
900
|
|
|
901
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
901
|
+
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)
|
|
902
902
|
|
|
903
903
|
All incident edges of a vertex.
|
|
904
904
|
|
|
@@ -932,7 +932,7 @@ Time O(deg_in + deg_out), Space O(deg_in + deg_out)
|
|
|
932
932
|
entries(): IterableIterator<[VertexKey, V | undefined]>;
|
|
933
933
|
```
|
|
934
934
|
|
|
935
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:31](https://github.com/zrwusa/data-structure-typed/blob/
|
|
935
|
+
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)
|
|
936
936
|
|
|
937
937
|
Iterate over `[key, value]` pairs (may yield `undefined` values).
|
|
938
938
|
|
|
@@ -958,7 +958,7 @@ Time O(n), Space O(1)
|
|
|
958
958
|
every(predicate, thisArg?): boolean;
|
|
959
959
|
```
|
|
960
960
|
|
|
961
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:66](https://github.com/zrwusa/data-structure-typed/blob/
|
|
961
|
+
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)
|
|
962
962
|
|
|
963
963
|
Test whether all entries satisfy the predicate.
|
|
964
964
|
|
|
@@ -998,7 +998,7 @@ Time O(n), Space O(1)
|
|
|
998
998
|
filter(predicate, thisArg?): this;
|
|
999
999
|
```
|
|
1000
1000
|
|
|
1001
|
-
Defined in: [data-structures/graph/abstract-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1001
|
+
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)
|
|
1002
1002
|
|
|
1003
1003
|
Induced-subgraph filter: keep vertices where `predicate(key, value)` is true,
|
|
1004
1004
|
and only keep edges whose endpoints both survive.
|
|
@@ -1039,7 +1039,7 @@ Time O(V + E), Space O(V + E)
|
|
|
1039
1039
|
filterEntries(predicate, thisArg?): [VertexKey, V | undefined][];
|
|
1040
1040
|
```
|
|
1041
1041
|
|
|
1042
|
-
Defined in: [data-structures/graph/abstract-graph.ts:913](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1042
|
+
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)
|
|
1043
1043
|
|
|
1044
1044
|
Preserve the old behavior: return filtered entries as an array.
|
|
1045
1045
|
|
|
@@ -1073,7 +1073,7 @@ Time O(V), Space O(V)
|
|
|
1073
1073
|
find(callbackfn, thisArg?): [VertexKey, V | undefined] | undefined;
|
|
1074
1074
|
```
|
|
1075
1075
|
|
|
1076
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:114](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1076
|
+
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)
|
|
1077
1077
|
|
|
1078
1078
|
Find the first entry that matches a predicate.
|
|
1079
1079
|
|
|
@@ -1113,7 +1113,7 @@ Time O(n), Space O(1)
|
|
|
1113
1113
|
floydWarshall(): object;
|
|
1114
1114
|
```
|
|
1115
1115
|
|
|
1116
|
-
Defined in: [data-structures/graph/abstract-graph.ts:798](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1116
|
+
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)
|
|
1117
1117
|
|
|
1118
1118
|
Floyd–Warshall all-pairs shortest paths.
|
|
1119
1119
|
|
|
@@ -1151,7 +1151,7 @@ Time O(V^3), Space O(V^2)
|
|
|
1151
1151
|
forEach(callbackfn, thisArg?): void;
|
|
1152
1152
|
```
|
|
1153
1153
|
|
|
1154
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:99](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1154
|
+
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)
|
|
1155
1155
|
|
|
1156
1156
|
Visit each entry, left-to-right.
|
|
1157
1157
|
|
|
@@ -1189,7 +1189,7 @@ Time O(n), Space O(1)
|
|
|
1189
1189
|
get(key): V | undefined;
|
|
1190
1190
|
```
|
|
1191
1191
|
|
|
1192
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:156](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1192
|
+
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)
|
|
1193
1193
|
|
|
1194
1194
|
Get the value under a key.
|
|
1195
1195
|
|
|
@@ -1226,7 +1226,7 @@ getAllPathsBetween(
|
|
|
1226
1226
|
limit?): VO[][];
|
|
1227
1227
|
```
|
|
1228
1228
|
|
|
1229
|
-
Defined in: [data-structures/graph/abstract-graph.ts:309](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1229
|
+
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)
|
|
1230
1230
|
|
|
1231
1231
|
Enumerate simple paths up to a limit.
|
|
1232
1232
|
|
|
@@ -1272,7 +1272,7 @@ Time O(paths) worst-case exponential, Space O(V + paths)
|
|
|
1272
1272
|
getCycles(isInclude2Cycle?): VertexKey[][];
|
|
1273
1273
|
```
|
|
1274
1274
|
|
|
1275
|
-
Defined in: [data-structures/graph/abstract-graph.ts:838](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1275
|
+
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)
|
|
1276
1276
|
|
|
1277
1277
|
Enumerate simple cycles (may be expensive).
|
|
1278
1278
|
|
|
@@ -1306,7 +1306,7 @@ Time exponential in worst-case, Space O(V + E)
|
|
|
1306
1306
|
getDestinations(vertex): VO[];
|
|
1307
1307
|
```
|
|
1308
1308
|
|
|
1309
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1309
|
+
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)
|
|
1310
1310
|
|
|
1311
1311
|
Direct children reachable by one outgoing edge.
|
|
1312
1312
|
|
|
@@ -1340,7 +1340,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
1340
1340
|
getDFNMap(): Map<VO, number>;
|
|
1341
1341
|
```
|
|
1342
1342
|
|
|
1343
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1343
|
+
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)
|
|
1344
1344
|
|
|
1345
1345
|
DFN index map computed by `tarjan()`.
|
|
1346
1346
|
|
|
@@ -1366,7 +1366,7 @@ Time O(V), Space O(V)
|
|
|
1366
1366
|
getEdge(srcOrKey, destOrKey): EO | undefined;
|
|
1367
1367
|
```
|
|
1368
1368
|
|
|
1369
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1369
|
+
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)
|
|
1370
1370
|
|
|
1371
1371
|
Get the unique edge from `src` to `dest`, if present.
|
|
1372
1372
|
|
|
@@ -1420,7 +1420,7 @@ Time O(1) avg, Space O(1)
|
|
|
1420
1420
|
getEndsOfEdge(edge): [VO, VO] | undefined;
|
|
1421
1421
|
```
|
|
1422
1422
|
|
|
1423
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1423
|
+
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)
|
|
1424
1424
|
|
|
1425
1425
|
Resolve an edge's `[src, dest]` endpoints to vertex instances.
|
|
1426
1426
|
|
|
@@ -1454,7 +1454,7 @@ Time O(1), Space O(1)
|
|
|
1454
1454
|
getLowMap(): Map<VO, number>;
|
|
1455
1455
|
```
|
|
1456
1456
|
|
|
1457
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1457
|
+
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)
|
|
1458
1458
|
|
|
1459
1459
|
LOW link map computed by `tarjan()`.
|
|
1460
1460
|
|
|
@@ -1483,7 +1483,7 @@ getMinCostBetween(
|
|
|
1483
1483
|
isWeight?): number | undefined;
|
|
1484
1484
|
```
|
|
1485
1485
|
|
|
1486
|
-
Defined in: [data-structures/graph/abstract-graph.ts:362](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1486
|
+
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)
|
|
1487
1487
|
|
|
1488
1488
|
Minimum hops/weight between two vertices.
|
|
1489
1489
|
|
|
@@ -1533,7 +1533,7 @@ getMinPathBetween(
|
|
|
1533
1533
|
isDFS?): VO[] | undefined;
|
|
1534
1534
|
```
|
|
1535
1535
|
|
|
1536
|
-
Defined in: [data-structures/graph/abstract-graph.ts:415](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1536
|
+
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)
|
|
1537
1537
|
|
|
1538
1538
|
Minimum path (as vertex sequence) between two vertices.
|
|
1539
1539
|
|
|
@@ -1585,7 +1585,7 @@ Time O((V + E) log V) weighted / O(V + E) unweighted, Space O(V + E)
|
|
|
1585
1585
|
getNeighbors(vertexOrKey): VO[];
|
|
1586
1586
|
```
|
|
1587
1587
|
|
|
1588
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1588
|
+
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)
|
|
1589
1589
|
|
|
1590
1590
|
Get outgoing neighbors
|
|
1591
1591
|
|
|
@@ -1627,7 +1627,7 @@ Get outgoing neighbors
|
|
|
1627
1627
|
getPathSumWeight(path): number;
|
|
1628
1628
|
```
|
|
1629
1629
|
|
|
1630
|
-
Defined in: [data-structures/graph/abstract-graph.ts:346](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1630
|
+
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)
|
|
1631
1631
|
|
|
1632
1632
|
Sum the weights along a vertex path.
|
|
1633
1633
|
|
|
@@ -1661,7 +1661,7 @@ Time O(L), Space O(1) where L is path length
|
|
|
1661
1661
|
getSCCs(): Map<number, VO[]>;
|
|
1662
1662
|
```
|
|
1663
1663
|
|
|
1664
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1664
|
+
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)
|
|
1665
1665
|
|
|
1666
1666
|
Strongly connected components computed by `tarjan()`.
|
|
1667
1667
|
|
|
@@ -1704,7 +1704,7 @@ Time O(#SCC + V), Space O(V)
|
|
|
1704
1704
|
getVertex(vertexKey): VO | undefined;
|
|
1705
1705
|
```
|
|
1706
1706
|
|
|
1707
|
-
Defined in: [data-structures/graph/abstract-graph.ts:175](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1707
|
+
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)
|
|
1708
1708
|
|
|
1709
1709
|
Get vertex instance by key.
|
|
1710
1710
|
|
|
@@ -1738,7 +1738,7 @@ Time O(1), Space O(1)
|
|
|
1738
1738
|
has(key): boolean;
|
|
1739
1739
|
```
|
|
1740
1740
|
|
|
1741
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:129](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1741
|
+
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)
|
|
1742
1742
|
|
|
1743
1743
|
Whether the given key exists.
|
|
1744
1744
|
|
|
@@ -1772,7 +1772,7 @@ Time O(n) generic, Space O(1)
|
|
|
1772
1772
|
hasEdge(v1, v2): boolean;
|
|
1773
1773
|
```
|
|
1774
1774
|
|
|
1775
|
-
Defined in: [data-structures/graph/abstract-graph.ts:249](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1775
|
+
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)
|
|
1776
1776
|
|
|
1777
1777
|
Whether an edge exists between two vertices.
|
|
1778
1778
|
|
|
@@ -1812,7 +1812,7 @@ Time O(1) avg, Space O(1)
|
|
|
1812
1812
|
hasValue(value): boolean;
|
|
1813
1813
|
```
|
|
1814
1814
|
|
|
1815
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:143](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1815
|
+
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)
|
|
1816
1816
|
|
|
1817
1817
|
Whether there exists an entry with the given value.
|
|
1818
1818
|
|
|
@@ -1846,7 +1846,7 @@ Time O(n), Space O(1)
|
|
|
1846
1846
|
hasVertex(vertexOrKey): boolean;
|
|
1847
1847
|
```
|
|
1848
1848
|
|
|
1849
|
-
Defined in: [data-structures/graph/abstract-graph.ts:185](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1849
|
+
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)
|
|
1850
1850
|
|
|
1851
1851
|
Whether a vertex exists.
|
|
1852
1852
|
|
|
@@ -1880,7 +1880,7 @@ Time O(1) avg, Space O(1)
|
|
|
1880
1880
|
incomingEdgesOf(vertexOrKey): EO[];
|
|
1881
1881
|
```
|
|
1882
1882
|
|
|
1883
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1883
|
+
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)
|
|
1884
1884
|
|
|
1885
1885
|
Incoming edges of a vertex.
|
|
1886
1886
|
|
|
@@ -1929,7 +1929,7 @@ Time O(deg_in), Space O(deg_in)
|
|
|
1929
1929
|
isEmpty(): boolean;
|
|
1930
1930
|
```
|
|
1931
1931
|
|
|
1932
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
1932
|
+
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)
|
|
1933
1933
|
|
|
1934
1934
|
Whether the graph has no vertices and no edges.
|
|
1935
1935
|
|
|
@@ -1953,7 +1953,7 @@ Time O(1), Space O(1)
|
|
|
1953
1953
|
isVertexKey(potentialKey): potentialKey is VertexKey;
|
|
1954
1954
|
```
|
|
1955
1955
|
|
|
1956
|
-
Defined in: [data-structures/graph/abstract-graph.ts:215](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1956
|
+
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)
|
|
1957
1957
|
|
|
1958
1958
|
Type guard: check if a value is a valid vertex key.
|
|
1959
1959
|
|
|
@@ -1987,7 +1987,7 @@ Time O(1), Space O(1)
|
|
|
1987
1987
|
keys(): IterableIterator<VertexKey>;
|
|
1988
1988
|
```
|
|
1989
1989
|
|
|
1990
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:42](https://github.com/zrwusa/data-structure-typed/blob/
|
|
1990
|
+
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)
|
|
1991
1991
|
|
|
1992
1992
|
Iterate over keys only.
|
|
1993
1993
|
|
|
@@ -2013,7 +2013,7 @@ Time O(n), Space O(1)
|
|
|
2013
2013
|
map<T>(callback, thisArg?): T[];
|
|
2014
2014
|
```
|
|
2015
2015
|
|
|
2016
|
-
Defined in: [data-structures/graph/abstract-graph.ts:928](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2016
|
+
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)
|
|
2017
2017
|
|
|
2018
2018
|
Map entries using an implementation-specific strategy.
|
|
2019
2019
|
|
|
@@ -2053,7 +2053,7 @@ Time O(n), Space O(n)
|
|
|
2053
2053
|
outgoingEdgesOf(vertexOrKey): EO[];
|
|
2054
2054
|
```
|
|
2055
2055
|
|
|
2056
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2056
|
+
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)
|
|
2057
2057
|
|
|
2058
2058
|
Outgoing edges of a vertex.
|
|
2059
2059
|
|
|
@@ -2102,7 +2102,7 @@ Time O(deg_out), Space O(deg_out)
|
|
|
2102
2102
|
print(options?): void;
|
|
2103
2103
|
```
|
|
2104
2104
|
|
|
2105
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1183](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2105
|
+
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)
|
|
2106
2106
|
|
|
2107
2107
|
Print the graph to console.
|
|
2108
2108
|
|
|
@@ -2132,7 +2132,7 @@ Display settings passed to `toVisual`.
|
|
|
2132
2132
|
reduce<U>(callbackfn, initialValue): U;
|
|
2133
2133
|
```
|
|
2134
2134
|
|
|
2135
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:171](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2135
|
+
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)
|
|
2136
2136
|
|
|
2137
2137
|
Reduce entries into a single accumulator.
|
|
2138
2138
|
|
|
@@ -2178,7 +2178,7 @@ Time O(n), Space O(1)
|
|
|
2178
2178
|
removeManyVertices(vertexMap): boolean;
|
|
2179
2179
|
```
|
|
2180
2180
|
|
|
2181
|
-
Defined in: [data-structures/graph/abstract-graph.ts:234](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2181
|
+
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)
|
|
2182
2182
|
|
|
2183
2183
|
Delete multiple vertices.
|
|
2184
2184
|
|
|
@@ -2215,7 +2215,7 @@ setEdgeWeight(
|
|
|
2215
2215
|
weight): boolean;
|
|
2216
2216
|
```
|
|
2217
2217
|
|
|
2218
|
-
Defined in: [data-structures/graph/abstract-graph.ts:291](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2218
|
+
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)
|
|
2219
2219
|
|
|
2220
2220
|
Set the weight of an existing edge.
|
|
2221
2221
|
|
|
@@ -2261,7 +2261,7 @@ Time O(1) avg, Space O(1)
|
|
|
2261
2261
|
some(predicate, thisArg?): boolean;
|
|
2262
2262
|
```
|
|
2263
2263
|
|
|
2264
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:83](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2264
|
+
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)
|
|
2265
2265
|
|
|
2266
2266
|
Test whether any entry satisfies the predicate.
|
|
2267
2267
|
|
|
@@ -2301,7 +2301,7 @@ Time O(n), Space O(1)
|
|
|
2301
2301
|
tarjan(): object;
|
|
2302
2302
|
```
|
|
2303
2303
|
|
|
2304
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2304
|
+
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)
|
|
2305
2305
|
|
|
2306
2306
|
Tarjan's algorithm for strongly connected components.
|
|
2307
2307
|
|
|
@@ -2364,7 +2364,7 @@ Time O(V + E), Space O(V + E)
|
|
|
2364
2364
|
toArray(): [VertexKey, V | undefined][];
|
|
2365
2365
|
```
|
|
2366
2366
|
|
|
2367
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:186](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2367
|
+
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)
|
|
2368
2368
|
|
|
2369
2369
|
Converts data structure to `[key, value]` pairs.
|
|
2370
2370
|
|
|
@@ -2390,7 +2390,7 @@ Time O(n), Space O(n)
|
|
|
2390
2390
|
toDot(options?): string;
|
|
2391
2391
|
```
|
|
2392
2392
|
|
|
2393
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1143](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2393
|
+
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)
|
|
2394
2394
|
|
|
2395
2395
|
Generate DOT language representation for Graphviz.
|
|
2396
2396
|
|
|
@@ -2430,7 +2430,7 @@ DOT format string.
|
|
|
2430
2430
|
topologicalSort(propertyName?): (VertexKey | VO)[] | undefined;
|
|
2431
2431
|
```
|
|
2432
2432
|
|
|
2433
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2433
|
+
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)
|
|
2434
2434
|
|
|
2435
2435
|
Topological sort if DAG; returns `undefined` if a cycle exists.
|
|
2436
2436
|
|
|
@@ -2492,7 +2492,7 @@ Time O(V + E), Space O(V)
|
|
|
2492
2492
|
toVisual(options?): string;
|
|
2493
2493
|
```
|
|
2494
2494
|
|
|
2495
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1108](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2495
|
+
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)
|
|
2496
2496
|
|
|
2497
2497
|
Generate a text-based visual representation of the graph.
|
|
2498
2498
|
|
|
@@ -2536,7 +2536,7 @@ The visual string.
|
|
|
2536
2536
|
values(): IterableIterator<V | undefined>;
|
|
2537
2537
|
```
|
|
2538
2538
|
|
|
2539
|
-
Defined in: [data-structures/base/iterable-entry-base.ts:53](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2539
|
+
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)
|
|
2540
2540
|
|
|
2541
2541
|
Iterate over values only.
|
|
2542
2542
|
|
|
@@ -2562,7 +2562,7 @@ Time O(n), Space O(1)
|
|
|
2562
2562
|
static fromEntries<V>(entries): DirectedGraph<V, undefined, DirectedVertex<V>, DirectedEdge<undefined>>;
|
|
2563
2563
|
```
|
|
2564
2564
|
|
|
2565
|
-
Defined in: [data-structures/graph/directed-graph.ts:182](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2565
|
+
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)
|
|
2566
2566
|
|
|
2567
2567
|
Construct a directed graph from `[key, value]` entries.
|
|
2568
2568
|
|
|
@@ -2604,7 +2604,7 @@ Time O(V), Space O(V)
|
|
|
2604
2604
|
static fromKeys<K>(keys): DirectedGraph<K, undefined, DirectedVertex<K>, DirectedEdge<undefined>>;
|
|
2605
2605
|
```
|
|
2606
2606
|
|
|
2607
|
-
Defined in: [data-structures/graph/directed-graph.ts:167](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2607
|
+
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)
|
|
2608
2608
|
|
|
2609
2609
|
Construct a directed graph from keys with value initializer `v => v`.
|
|
2610
2610
|
|
|
@@ -2651,7 +2651,7 @@ Time O(V), Space O(V)
|
|
|
2651
2651
|
get protected _edgeConnector(): string;
|
|
2652
2652
|
```
|
|
2653
2653
|
|
|
2654
|
-
Defined in: [data-structures/graph/directed-graph.ts:136](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2654
|
+
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)
|
|
2655
2655
|
|
|
2656
2656
|
The edge connector string used in visual output.
|
|
2657
2657
|
Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
@@ -2672,7 +2672,7 @@ Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
|
2672
2672
|
protected _addEdge(edge): boolean;
|
|
2673
2673
|
```
|
|
2674
2674
|
|
|
2675
|
-
Defined in: [data-structures/graph/directed-graph.ts:
|
|
2675
|
+
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)
|
|
2676
2676
|
|
|
2677
2677
|
Internal hook to attach a directed edge into adjacency maps.
|
|
2678
2678
|
|
|
@@ -2706,7 +2706,7 @@ Time O(1) avg, Space O(1)
|
|
|
2706
2706
|
protected _addVertex(newVertex): boolean;
|
|
2707
2707
|
```
|
|
2708
2708
|
|
|
2709
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1054](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2709
|
+
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)
|
|
2710
2710
|
|
|
2711
2711
|
Insert a pre-built vertex into the graph.
|
|
2712
2712
|
|
|
@@ -2740,7 +2740,7 @@ Time O(1) avg, Space O(1)
|
|
|
2740
2740
|
protected _createInstance(options?): this;
|
|
2741
2741
|
```
|
|
2742
2742
|
|
|
2743
|
-
Defined in: [data-structures/graph/map-graph.ts:181](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2743
|
+
Defined in: [data-structures/graph/map-graph.ts:181](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L181)
|
|
2744
2744
|
|
|
2745
2745
|
Re-create a same-species MapGraph instance from snapshot options.
|
|
2746
2746
|
|
|
@@ -2774,7 +2774,7 @@ Time O(1), Space O(1)
|
|
|
2774
2774
|
protected _createLike(iter?, options?): this;
|
|
2775
2775
|
```
|
|
2776
2776
|
|
|
2777
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1009](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2777
|
+
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)
|
|
2778
2778
|
|
|
2779
2779
|
Create a same-species graph populated with entries; preserves edges among kept vertices.
|
|
2780
2780
|
|
|
@@ -2814,7 +2814,7 @@ Time O(V + E), Space O(V + E)
|
|
|
2814
2814
|
protected _getIterator(): IterableIterator<[VertexKey, V | undefined]>;
|
|
2815
2815
|
```
|
|
2816
2816
|
|
|
2817
|
-
Defined in: [data-structures/graph/abstract-graph.ts:958](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2817
|
+
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)
|
|
2818
2818
|
|
|
2819
2819
|
Internal iterator over `[key, value]` entries in insertion order.
|
|
2820
2820
|
|
|
@@ -2840,7 +2840,7 @@ Time O(V), Space O(1)
|
|
|
2840
2840
|
protected _getVertex(vertexOrKey): VO | undefined;
|
|
2841
2841
|
```
|
|
2842
2842
|
|
|
2843
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1068](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2843
|
+
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)
|
|
2844
2844
|
|
|
2845
2845
|
Resolve a vertex key or instance to the concrete vertex instance.
|
|
2846
2846
|
|
|
@@ -2874,7 +2874,7 @@ Time O(1), Space O(1)
|
|
|
2874
2874
|
protected _getVertexKey(vertexOrKey): VertexKey;
|
|
2875
2875
|
```
|
|
2876
2876
|
|
|
2877
|
-
Defined in: [data-structures/graph/abstract-graph.ts:1079](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2877
|
+
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)
|
|
2878
2878
|
|
|
2879
2879
|
Resolve a vertex key from a key or vertex instance.
|
|
2880
2880
|
|
|
@@ -2908,7 +2908,7 @@ Time O(1), Space O(1)
|
|
|
2908
2908
|
protected _snapshotOptions(): Record<string, unknown>;
|
|
2909
2909
|
```
|
|
2910
2910
|
|
|
2911
|
-
Defined in: [data-structures/graph/map-graph.ts:171](https://github.com/zrwusa/data-structure-typed/blob/
|
|
2911
|
+
Defined in: [data-structures/graph/map-graph.ts:171](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/map-graph.ts#L171)
|
|
2912
2912
|
|
|
2913
2913
|
Include `originCoord` and `bottomRight` so `clone()/filter()` preserve geospatial settings.
|
|
2914
2914
|
|