data-structure-typed 1.18.0 → 1.18.6
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/README.md +193 -66
- package/backup/recursive-type/src/assets/complexities-diff.jpg +0 -0
- package/backup/recursive-type/src/assets/data-structure-complexities.jpg +0 -0
- package/backup/recursive-type/src/assets/logo.png +0 -0
- package/backup/recursive-type/src/assets/overview-diagram-of-data-structures.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/aa-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/avl-tree.ts +288 -0
- package/backup/recursive-type/src/data-structures/binary-tree/b-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-indexed-tree.ts +78 -0
- package/backup/recursive-type/src/data-structures/binary-tree/binary-tree.ts +1502 -0
- package/backup/recursive-type/src/data-structures/binary-tree/bst.ts +503 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/avl-tree-inserting.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/bst-rotation.gif +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/diagrams/segment-tree.png +0 -0
- package/backup/recursive-type/src/data-structures/binary-tree/index.ts +11 -0
- package/backup/recursive-type/src/data-structures/binary-tree/rb-tree.ts +110 -0
- package/backup/recursive-type/src/data-structures/binary-tree/segment-tree.ts +243 -0
- package/backup/recursive-type/src/data-structures/binary-tree/splay-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/binary-tree/tree-multiset.ts +55 -0
- package/backup/recursive-type/src/data-structures/binary-tree/two-three-tree.ts +3 -0
- package/backup/recursive-type/src/data-structures/diagrams/README.md +5 -0
- package/backup/recursive-type/src/data-structures/graph/abstract-graph.ts +985 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/mst.jpg +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-articulation-point-bridge.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-complicate-simple.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan-strongly-connected-component.png +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.mp4 +0 -0
- package/backup/recursive-type/src/data-structures/graph/diagrams/tarjan.webp +0 -0
- package/backup/recursive-type/src/data-structures/graph/directed-graph.ts +478 -0
- package/backup/recursive-type/src/data-structures/graph/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/graph/undirected-graph.ts +293 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-map.ts +67 -0
- package/backup/recursive-type/src/data-structures/hash/coordinate-set.ts +56 -0
- package/backup/recursive-type/src/data-structures/hash/hash-table.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/index.ts +6 -0
- package/backup/recursive-type/src/data-structures/hash/pair.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-map.ts +3 -0
- package/backup/recursive-type/src/data-structures/hash/tree-set.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/heap.ts +176 -0
- package/backup/recursive-type/src/data-structures/heap/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/heap/max-heap.ts +31 -0
- package/backup/recursive-type/src/data-structures/heap/min-heap.ts +34 -0
- package/backup/recursive-type/src/data-structures/index.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/abstract-graph.ts +42 -0
- package/backup/recursive-type/src/data-structures/interfaces/avl-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/binary-tree.ts +56 -0
- package/backup/recursive-type/src/data-structures/interfaces/bst.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/directed-graph.ts +15 -0
- package/backup/recursive-type/src/data-structures/interfaces/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/heap.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/index.ts +13 -0
- package/backup/recursive-type/src/data-structures/interfaces/navigator.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/priority-queue.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/data-structures/interfaces/undirected-graph.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/doubly-linked-list.ts +573 -0
- package/backup/recursive-type/src/data-structures/linked-list/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/linked-list/singly-linked-list.ts +490 -0
- package/backup/recursive-type/src/data-structures/linked-list/skip-linked-list.ts +3 -0
- package/backup/recursive-type/src/data-structures/matrix/index.ts +4 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix.ts +27 -0
- package/backup/recursive-type/src/data-structures/matrix/matrix2d.ts +208 -0
- package/backup/recursive-type/src/data-structures/matrix/navigator.ts +122 -0
- package/backup/recursive-type/src/data-structures/matrix/vector2d.ts +316 -0
- package/backup/recursive-type/src/data-structures/priority-queue/index.ts +3 -0
- package/backup/recursive-type/src/data-structures/priority-queue/max-priority-queue.ts +49 -0
- package/backup/recursive-type/src/data-structures/priority-queue/min-priority-queue.ts +50 -0
- package/backup/recursive-type/src/data-structures/priority-queue/priority-queue.ts +354 -0
- package/backup/recursive-type/src/data-structures/queue/deque.ts +251 -0
- package/backup/recursive-type/src/data-structures/queue/index.ts +2 -0
- package/backup/recursive-type/src/data-structures/queue/queue.ts +120 -0
- package/backup/recursive-type/src/data-structures/stack/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/stack/stack.ts +98 -0
- package/backup/recursive-type/src/data-structures/tree/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/tree/tree.ts +80 -0
- package/backup/recursive-type/src/data-structures/trie/index.ts +1 -0
- package/backup/recursive-type/src/data-structures/trie/trie.ts +227 -0
- package/backup/recursive-type/src/data-structures/types/abstract-graph.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/avl-tree.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/binary-tree.ts +10 -0
- package/backup/recursive-type/src/data-structures/types/bst.ts +6 -0
- package/backup/recursive-type/src/data-structures/types/directed-graph.ts +8 -0
- package/backup/recursive-type/src/data-structures/types/doubly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/heap.ts +5 -0
- package/backup/recursive-type/src/data-structures/types/index.ts +12 -0
- package/backup/recursive-type/src/data-structures/types/navigator.ts +13 -0
- package/backup/recursive-type/src/data-structures/types/priority-queue.ts +9 -0
- package/backup/recursive-type/src/data-structures/types/segment-tree.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/singly-linked-list.ts +1 -0
- package/backup/recursive-type/src/data-structures/types/tree-multiset.ts +1 -0
- package/backup/recursive-type/src/index.ts +1 -0
- package/backup/recursive-type/src/utils/index.ts +2 -0
- package/backup/recursive-type/src/utils/types/index.ts +1 -0
- package/backup/recursive-type/src/utils/types/utils.ts +6 -0
- package/backup/recursive-type/src/utils/utils.ts +78 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +333 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +1455 -0
- package/dist/data-structures/binary-tree/avl-tree.d.ts +20 -25
- package/dist/data-structures/binary-tree/avl-tree.js +10 -18
- package/dist/data-structures/binary-tree/binary-tree.d.ts +18 -345
- package/dist/data-structures/binary-tree/binary-tree.js +39 -1444
- package/dist/data-structures/binary-tree/bst.d.ts +24 -31
- package/dist/data-structures/binary-tree/bst.js +46 -53
- package/dist/data-structures/binary-tree/index.d.ts +1 -0
- package/dist/data-structures/binary-tree/index.js +1 -0
- package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -2
- package/dist/data-structures/binary-tree/rb-tree.js +64 -5
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +11 -25
- package/dist/data-structures/binary-tree/tree-multiset.js +29 -31
- package/dist/data-structures/graph/abstract-graph.d.ts +56 -58
- package/dist/data-structures/graph/abstract-graph.js +84 -68
- package/dist/data-structures/graph/directed-graph.d.ts +124 -95
- package/dist/data-structures/graph/directed-graph.js +156 -108
- package/dist/data-structures/graph/undirected-graph.d.ts +83 -58
- package/dist/data-structures/graph/undirected-graph.js +98 -71
- package/dist/data-structures/hash/coordinate-set.d.ts +1 -1
- package/dist/data-structures/index.d.ts +1 -0
- package/dist/data-structures/index.js +1 -0
- package/dist/data-structures/interfaces/abstract-graph.d.ts +22 -0
- package/dist/data-structures/interfaces/abstract-graph.js +2 -0
- package/dist/data-structures/interfaces/avl-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/avl-tree.js +2 -0
- package/dist/data-structures/interfaces/binary-tree.d.ts +26 -0
- package/dist/data-structures/interfaces/binary-tree.js +2 -0
- package/dist/data-structures/interfaces/bst.d.ts +1 -0
- package/dist/data-structures/interfaces/bst.js +2 -0
- package/dist/data-structures/interfaces/directed-graph.d.ts +9 -0
- package/dist/data-structures/interfaces/directed-graph.js +2 -0
- package/dist/data-structures/interfaces/doubly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/doubly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/heap.d.ts +1 -0
- package/dist/data-structures/interfaces/heap.js +2 -0
- package/dist/data-structures/interfaces/index.d.ts +13 -0
- package/dist/data-structures/interfaces/index.js +29 -0
- package/dist/data-structures/interfaces/navigator.d.ts +1 -0
- package/dist/data-structures/interfaces/navigator.js +2 -0
- package/dist/data-structures/interfaces/priority-queue.d.ts +1 -0
- package/dist/data-structures/interfaces/priority-queue.js +2 -0
- package/dist/data-structures/interfaces/segment-tree.d.ts +1 -0
- package/dist/data-structures/interfaces/segment-tree.js +2 -0
- package/dist/data-structures/interfaces/singly-linked-list.d.ts +1 -0
- package/dist/data-structures/interfaces/singly-linked-list.js +2 -0
- package/dist/data-structures/interfaces/tree-multiset.d.ts +1 -0
- package/dist/data-structures/interfaces/tree-multiset.js +2 -0
- package/dist/data-structures/interfaces/undirected-graph.d.ts +2 -0
- package/dist/data-structures/interfaces/undirected-graph.js +2 -0
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +4 -4
- package/dist/data-structures/queue/deque.d.ts +5 -5
- package/dist/data-structures/queue/deque.js +6 -6
- package/dist/data-structures/queue/queue.d.ts +1 -1
- package/dist/data-structures/stack/stack.d.ts +1 -1
- package/dist/data-structures/types/abstract-binary-tree.d.ts +32 -0
- package/dist/data-structures/types/abstract-binary-tree.js +21 -0
- package/dist/data-structures/types/abstract-graph.d.ts +1 -20
- package/dist/data-structures/types/avl-tree.d.ts +3 -4
- package/dist/data-structures/types/binary-tree.d.ts +3 -10
- package/dist/data-structures/types/bst.d.ts +10 -4
- package/dist/data-structures/types/bst.js +7 -0
- package/dist/data-structures/types/directed-graph.d.ts +5 -9
- package/dist/data-structures/types/directed-graph.js +7 -0
- package/dist/data-structures/types/heap.d.ts +2 -2
- package/dist/data-structures/types/helpers.d.ts +8 -0
- package/dist/data-structures/types/helpers.js +2 -0
- package/dist/data-structures/types/index.d.ts +3 -1
- package/dist/data-structures/types/index.js +3 -1
- package/dist/data-structures/types/navigator.d.ts +2 -2
- package/dist/data-structures/types/priority-queue.d.ts +2 -2
- package/dist/data-structures/types/rb-tree.d.ts +6 -0
- package/dist/data-structures/types/rb-tree.js +8 -0
- package/dist/data-structures/types/tree-multiset.d.ts +5 -4
- package/docs/assets/search.js +1 -1
- package/docs/classes/AVLTree.html +310 -309
- package/docs/classes/AVLTreeNode.html +122 -68
- package/docs/classes/AaTree.html +30 -17
- package/docs/classes/AbstractBinaryTree.html +2023 -0
- package/docs/classes/AbstractBinaryTreeNode.html +491 -0
- package/docs/classes/AbstractEdge.html +84 -39
- package/docs/classes/AbstractGraph.html +235 -119
- package/docs/classes/AbstractVertex.html +87 -35
- package/docs/classes/ArrayDeque.html +43 -30
- package/docs/classes/BST.html +297 -285
- package/docs/classes/BSTNode.html +123 -62
- package/docs/classes/BTree.html +30 -17
- package/docs/classes/BinaryIndexedTree.html +38 -25
- package/docs/classes/BinaryTree.html +596 -589
- package/docs/classes/BinaryTreeNode.html +181 -161
- package/docs/classes/Character.html +33 -20
- package/docs/classes/CoordinateMap.html +38 -25
- package/docs/classes/CoordinateSet.html +39 -26
- package/docs/classes/Deque.html +63 -50
- package/docs/classes/DirectedEdge.html +90 -46
- package/docs/classes/DirectedGraph.html +374 -212
- package/docs/classes/DirectedVertex.html +79 -41
- package/docs/classes/DoublyLinkedList.html +68 -55
- package/docs/classes/DoublyLinkedListNode.html +40 -27
- package/docs/classes/HashTable.html +30 -17
- package/docs/classes/Heap.html +45 -32
- package/docs/classes/HeapItem.html +37 -24
- package/docs/classes/Matrix2D.html +45 -32
- package/docs/classes/MatrixNTI2D.html +33 -20
- package/docs/classes/MaxHeap.html +45 -32
- package/docs/classes/MaxPriorityQueue.html +83 -65
- package/docs/classes/MinHeap.html +45 -32
- package/docs/classes/MinPriorityQueue.html +83 -65
- package/docs/classes/Navigator.html +40 -27
- package/docs/classes/ObjectDeque.html +78 -55
- package/docs/classes/Pair.html +30 -17
- package/docs/classes/PriorityQueue.html +78 -60
- package/docs/classes/Queue.html +45 -32
- package/docs/classes/SegmentTree.html +46 -33
- package/docs/classes/SegmentTreeNode.html +49 -36
- package/docs/classes/SinglyLinkedList.html +65 -52
- package/docs/classes/SinglyLinkedListNode.html +37 -24
- package/docs/classes/SkipLinkedList.html +30 -17
- package/docs/classes/SplayTree.html +30 -17
- package/docs/classes/Stack.html +43 -30
- package/docs/classes/TreeMap.html +30 -17
- package/docs/classes/TreeMultiSet.html +330 -316
- package/docs/classes/TreeMultiSetNode.html +450 -0
- package/docs/classes/TreeNode.html +45 -32
- package/docs/classes/TreeSet.html +30 -17
- package/docs/classes/Trie.html +42 -29
- package/docs/classes/TrieNode.html +40 -27
- package/docs/classes/TwoThreeTree.html +30 -17
- package/docs/classes/UndirectedEdge.html +86 -56
- package/docs/classes/UndirectedGraph.html +286 -165
- package/docs/classes/UndirectedVertex.html +79 -41
- package/docs/classes/Vector2D.html +57 -44
- package/docs/enums/CP.html +36 -23
- package/docs/enums/FamilyPosition.html +48 -35
- package/docs/enums/LoopType.html +42 -29
- package/docs/{interfaces/PriorityQueueOptions.html → enums/RBColor.html} +52 -55
- package/docs/{interfaces/AVLTreeDeleted.html → enums/TopologicalProperty.html} +59 -48
- package/docs/index.html +211 -73
- package/docs/interfaces/{NavigatorParams.html → IBinaryTree.html} +56 -67
- package/docs/interfaces/IBinaryTreeNode.html +396 -0
- package/docs/interfaces/IDirectedGraph.html +36 -23
- package/docs/interfaces/IGraph.html +134 -93
- package/docs/interfaces/{HeapOptions.html → IUNDirectedGraph.html} +38 -57
- package/docs/modules.html +57 -31
- package/docs/types/{ToThunkFn.html → AVLTreeOptions.html} +35 -27
- package/docs/types/AbstractBinaryTreeOptions.html +150 -0
- package/docs/types/AbstractRecursiveBinaryTreeNode.html +146 -0
- package/docs/types/{ResultsByProperty.html → AbstractResultByProperty.html} +35 -22
- package/docs/types/{TreeMultiSetDeletedResult.html → AbstractResultsByProperty.html} +35 -29
- package/docs/types/BSTComparator.html +30 -17
- package/docs/types/{TrlAsyncFn.html → BSTOptions.html} +36 -31
- package/docs/types/BinaryTreeDeletedResult.html +153 -0
- package/docs/types/BinaryTreeNodeId.html +30 -17
- package/docs/types/BinaryTreeNodePropertyName.html +30 -17
- package/docs/types/{BinaryTreeDeleted.html → BinaryTreeOptions.html} +35 -31
- package/docs/types/DFSOrderPattern.html +30 -17
- package/docs/types/DijkstraResult.html +30 -17
- package/docs/types/Direction.html +30 -17
- package/docs/types/{SpecifyOptional.html → EdgeId.html} +34 -28
- package/docs/types/{TrlFn.html → HeapOptions.html} +45 -24
- package/docs/types/IdObject.html +151 -0
- package/docs/types/{BSTDeletedResult.html → KeyValObject.html} +36 -30
- package/docs/types/NavigatorParams.html +175 -0
- package/docs/types/NodeOrPropertyName.html +30 -17
- package/docs/types/PriorityQueueComparator.html +30 -17
- package/docs/types/PriorityQueueDFSOrderPattern.html +30 -17
- package/docs/types/PriorityQueueOptions.html +155 -0
- package/docs/types/{Thunk.html → RBTreeOptions.html} +35 -27
- package/docs/types/RecursiveAVLTreeNode.html +146 -0
- package/docs/types/RecursiveBSTNode.html +146 -0
- package/docs/types/RecursiveBinaryTreeNode.html +146 -0
- package/docs/types/RecursiveTreeMultiSetNode.html +146 -0
- package/docs/types/SegmentTreeNodeVal.html +30 -17
- package/docs/types/TopologicalStatus.html +30 -17
- package/docs/types/TreeMultiSetOptions.html +146 -0
- package/docs/types/Turning.html +30 -17
- package/docs/types/VertexId.html +30 -17
- package/notes/note.md +8 -1
- package/package.json +10 -2
- package/docs/classes/RBTree.html +0 -153
- package/docs/types/ResultByProperty.html +0 -133
|
@@ -64,12 +64,14 @@ var abstract_graph_1 = require("./abstract-graph");
|
|
|
64
64
|
var DirectedVertex = /** @class */ (function (_super) {
|
|
65
65
|
__extends(DirectedVertex, _super);
|
|
66
66
|
/**
|
|
67
|
-
* The constructor function initializes
|
|
68
|
-
* @param {VertexId} id - The `id` parameter is the identifier for the vertex. It is
|
|
69
|
-
* vertex
|
|
67
|
+
* The constructor function initializes a vertex with an optional value.
|
|
68
|
+
* @param {VertexId} id - The `id` parameter is the identifier for the vertex. It is of type `VertexId`, which is
|
|
69
|
+
* typically a unique identifier for each vertex in a graph.
|
|
70
|
+
* @param {T} [val] - The "val" parameter is an optional parameter of type T. It is used to specify the value
|
|
71
|
+
* associated with the vertex.
|
|
70
72
|
*/
|
|
71
|
-
function DirectedVertex(id) {
|
|
72
|
-
return _super.call(this, id) || this;
|
|
73
|
+
function DirectedVertex(id, val) {
|
|
74
|
+
return _super.call(this, id, val) || this;
|
|
73
75
|
}
|
|
74
76
|
return DirectedVertex;
|
|
75
77
|
}(abstract_graph_1.AbstractVertex));
|
|
@@ -77,16 +79,19 @@ exports.DirectedVertex = DirectedVertex;
|
|
|
77
79
|
var DirectedEdge = /** @class */ (function (_super) {
|
|
78
80
|
__extends(DirectedEdge, _super);
|
|
79
81
|
/**
|
|
80
|
-
* The constructor function initializes the source and destination vertices of an edge, with an optional weight
|
|
82
|
+
* The constructor function initializes the source and destination vertices of an edge, along with an optional weight
|
|
83
|
+
* and value.
|
|
81
84
|
* @param {VertexId} src - The `src` parameter is the source vertex ID. It represents the starting point of an edge in
|
|
82
85
|
* a graph.
|
|
83
|
-
* @param {VertexId} dest - The `dest` parameter is the identifier of the destination vertex
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
86
|
+
* @param {VertexId} dest - The `dest` parameter is the identifier of the destination vertex for an edge.
|
|
87
|
+
* @param {number} [weight] - The `weight` parameter is an optional number that represents the weight of the edge. It
|
|
88
|
+
* is used to assign a numerical value to the edge, which can be used in algorithms such as shortest path algorithms.
|
|
89
|
+
* If the weight is not provided, it will default to `undefined`.
|
|
90
|
+
* @param {T} [val] - The "val" parameter is an optional parameter of type T. It represents the value associated with
|
|
91
|
+
* the edge.
|
|
87
92
|
*/
|
|
88
|
-
function DirectedEdge(src, dest, weight) {
|
|
89
|
-
var _this = _super.call(this, weight) || this;
|
|
93
|
+
function DirectedEdge(src, dest, weight, val) {
|
|
94
|
+
var _this = _super.call(this, weight, val) || this;
|
|
90
95
|
_this._src = src;
|
|
91
96
|
_this._dest = dest;
|
|
92
97
|
return _this;
|
|
@@ -123,19 +128,53 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
123
128
|
_this._inEdgeMap = new Map();
|
|
124
129
|
return _this;
|
|
125
130
|
}
|
|
131
|
+
Object.defineProperty(DirectedGraph.prototype, "outEdgeMap", {
|
|
132
|
+
get: function () {
|
|
133
|
+
return this._outEdgeMap;
|
|
134
|
+
},
|
|
135
|
+
enumerable: false,
|
|
136
|
+
configurable: true
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(DirectedGraph.prototype, "inEdgeMap", {
|
|
139
|
+
get: function () {
|
|
140
|
+
return this._inEdgeMap;
|
|
141
|
+
},
|
|
142
|
+
enumerable: false,
|
|
143
|
+
configurable: true
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* In TypeScript, a subclass inherits the interface implementation of its parent class, without needing to implement the same interface again in the subclass. This behavior differs from Java's approach. In Java, if a parent class implements an interface, the subclass needs to explicitly implement the same interface, even if the parent class has already implemented it.
|
|
147
|
+
* This means that using abstract methods in the parent class cannot constrain the grandchild classes. Defining methods within an interface also cannot constrain the descendant classes. When inheriting from this class, developers need to be aware that this method needs to be overridden.
|
|
148
|
+
* @param id
|
|
149
|
+
* @param val
|
|
150
|
+
*/
|
|
151
|
+
DirectedGraph.prototype._createVertex = function (id, val) {
|
|
152
|
+
return new DirectedVertex(id, val !== null && val !== void 0 ? val : id);
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* In TypeScript, a subclass inherits the interface implementation of its parent class, without needing to implement the same interface again in the subclass. This behavior differs from Java's approach. In Java, if a parent class implements an interface, the subclass needs to explicitly implement the same interface, even if the parent class has already implemented it.
|
|
156
|
+
* This means that using abstract methods in the parent class cannot constrain the grandchild classes. Defining methods within an interface also cannot constrain the descendant classes. When inheriting from this class, developers need to be aware that this method needs to be overridden.
|
|
157
|
+
* @param src
|
|
158
|
+
* @param dest
|
|
159
|
+
* @param weight
|
|
160
|
+
* @param val
|
|
161
|
+
*/
|
|
162
|
+
DirectedGraph.prototype._createEdge = function (src, dest, weight, val) {
|
|
163
|
+
return new DirectedEdge(src, dest, weight !== null && weight !== void 0 ? weight : 1, val);
|
|
164
|
+
};
|
|
126
165
|
/**
|
|
127
|
-
* The function `getEdge` returns the
|
|
128
|
-
* @param {V | null | VertexId} srcOrId - The
|
|
129
|
-
*
|
|
130
|
-
* @param {V | null | VertexId} destOrId - The `destOrId` parameter is
|
|
131
|
-
*
|
|
132
|
-
* @returns
|
|
166
|
+
* The function `getEdge` returns the directed edge between two vertices, given their source and destination.
|
|
167
|
+
* @param {V | null | VertexId} srcOrId - The source vertex or its ID. It can be either a
|
|
168
|
+
* DirectedVertex object or a VertexId.
|
|
169
|
+
* @param {V | null | VertexId} destOrId - The `destOrId` parameter is the destination vertex or its
|
|
170
|
+
* ID. It can be either a `DirectedVertex` object or a `VertexId` value.
|
|
171
|
+
* @returns a E object or null.
|
|
133
172
|
*/
|
|
134
173
|
DirectedGraph.prototype.getEdge = function (srcOrId, destOrId) {
|
|
135
174
|
var edges = [];
|
|
136
175
|
if (srcOrId !== null && destOrId !== null) {
|
|
137
|
-
var src = this.
|
|
138
|
-
var dest_1 = this.
|
|
176
|
+
var src = this._getVertex(srcOrId);
|
|
177
|
+
var dest_1 = this._getVertex(destOrId);
|
|
139
178
|
if (src && dest_1) {
|
|
140
179
|
var srcOutEdges = this._outEdgeMap.get(src);
|
|
141
180
|
if (srcOutEdges) {
|
|
@@ -146,18 +185,18 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
146
185
|
return edges[0] || null;
|
|
147
186
|
};
|
|
148
187
|
/**
|
|
149
|
-
* The `addEdge` function adds
|
|
150
|
-
* @param
|
|
151
|
-
*
|
|
152
|
-
* @returns The `addEdge`
|
|
153
|
-
* graph, and `false` if either the source or destination
|
|
188
|
+
* The `addEdge` function adds a directed edge to a graph if the source and destination vertices exist.
|
|
189
|
+
* @param edge - The parameter `edge` is of type `E`, which represents a directed edge in a graph. It
|
|
190
|
+
* contains two properties:
|
|
191
|
+
* @returns The method `addEdge` returns a boolean value. It returns `true` if the edge was successfully added to the
|
|
192
|
+
* graph, and `false` if either the source or destination vertex of the edge is not present in the graph.
|
|
154
193
|
*/
|
|
155
194
|
DirectedGraph.prototype.addEdge = function (edge) {
|
|
156
195
|
if (!(this.hasVertex(edge.src) && this.hasVertex(edge.dest))) {
|
|
157
196
|
return false;
|
|
158
197
|
}
|
|
159
|
-
var srcVertex = this.
|
|
160
|
-
var destVertex = this.
|
|
198
|
+
var srcVertex = this._getVertex(edge.src);
|
|
199
|
+
var destVertex = this._getVertex(edge.dest);
|
|
161
200
|
// TODO after no-non-null-assertion not ensure the logic
|
|
162
201
|
if (srcVertex && destVertex) {
|
|
163
202
|
var srcOutEdges = this._outEdgeMap.get(srcVertex);
|
|
@@ -181,18 +220,18 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
181
220
|
}
|
|
182
221
|
};
|
|
183
222
|
/**
|
|
184
|
-
* The function removes an edge between two vertices in a directed graph and returns the removed
|
|
185
|
-
*
|
|
186
|
-
* @param {V | VertexId}
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* edge does not exist
|
|
223
|
+
* The `removeEdgeBetween` function removes an edge between two vertices in a directed graph and returns the removed
|
|
224
|
+
* edge, or null if the edge was not found.
|
|
225
|
+
* @param {V | VertexId} srcOrId - The `srcOrId` parameter represents either a `V`
|
|
226
|
+
* object or a `VertexId` value. It is used to specify the source vertex of the edge that you want to remove.
|
|
227
|
+
* @param {V | VertexId} destOrId - The `destOrId` parameter represents the destination vertex of the
|
|
228
|
+
* edge that you want to remove. It can be either a `V` object or a `VertexId` value.
|
|
229
|
+
* @returns The function `removeEdgeBetween` returns the removed edge (`E`) if it exists, or `null` if
|
|
230
|
+
* the edge does not exist.
|
|
192
231
|
*/
|
|
193
232
|
DirectedGraph.prototype.removeEdgeBetween = function (srcOrId, destOrId) {
|
|
194
|
-
var src = this.
|
|
195
|
-
var dest = this.
|
|
233
|
+
var src = this._getVertex(srcOrId);
|
|
234
|
+
var dest = this._getVertex(destOrId);
|
|
196
235
|
var removed = null;
|
|
197
236
|
if (!src || !dest) {
|
|
198
237
|
return null;
|
|
@@ -216,16 +255,17 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
216
255
|
return removed;
|
|
217
256
|
};
|
|
218
257
|
/**
|
|
219
|
-
* The removeEdge function removes
|
|
220
|
-
* found.
|
|
221
|
-
* @param
|
|
222
|
-
*
|
|
223
|
-
* @returns The
|
|
258
|
+
* The `removeEdge` function removes a directed edge from a graph and returns the removed edge, or null if the edge was
|
|
259
|
+
* not found.
|
|
260
|
+
* @param edge - The `edge` parameter is an object of type `E`, which represents a directed edge in a
|
|
261
|
+
* graph. It has two properties:
|
|
262
|
+
* @returns The function `removeEdge` returns a `E` object if an edge is successfully removed, or `null`
|
|
263
|
+
* if no edge is removed.
|
|
224
264
|
*/
|
|
225
265
|
DirectedGraph.prototype.removeEdge = function (edge) {
|
|
226
266
|
var removed = null;
|
|
227
|
-
var src = this.
|
|
228
|
-
var dest = this.
|
|
267
|
+
var src = this._getVertex(edge.src);
|
|
268
|
+
var dest = this._getVertex(edge.dest);
|
|
229
269
|
if (src && dest) {
|
|
230
270
|
var srcOutEdges = this._outEdgeMap.get(src);
|
|
231
271
|
if (srcOutEdges && srcOutEdges.length > 0) {
|
|
@@ -240,95 +280,99 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
240
280
|
};
|
|
241
281
|
/**
|
|
242
282
|
* The function removeAllEdges removes all edges between two vertices.
|
|
243
|
-
* @param {VertexId | V} src - The `src` parameter
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @returns An empty array is being returned.
|
|
283
|
+
* @param {VertexId | V} src - The `src` parameter can be either a `VertexId` or a `V`.
|
|
284
|
+
* @param {VertexId | V} dest - The `dest` parameter represents the destination vertex of an edge. It
|
|
285
|
+
* can be either a `VertexId` or a `V`.
|
|
286
|
+
* @returns An empty array of DirectedEdge objects is being returned.
|
|
248
287
|
*/
|
|
249
288
|
DirectedGraph.prototype.removeAllEdges = function (src, dest) {
|
|
250
289
|
return [];
|
|
251
290
|
};
|
|
252
291
|
/**
|
|
253
|
-
* The function
|
|
254
|
-
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a
|
|
255
|
-
*
|
|
256
|
-
* @returns The method `incomingEdgesOf` returns an array of
|
|
292
|
+
* The function returns an array of incoming edges of a given vertex or vertex ID.
|
|
293
|
+
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a `V`
|
|
294
|
+
* object or a `VertexId`.
|
|
295
|
+
* @returns The method `incomingEdgesOf` returns an array of `E` objects.
|
|
257
296
|
*/
|
|
258
297
|
DirectedGraph.prototype.incomingEdgesOf = function (vertexOrId) {
|
|
259
|
-
var target = this.
|
|
298
|
+
var target = this._getVertex(vertexOrId);
|
|
260
299
|
if (target) {
|
|
261
|
-
return this.
|
|
300
|
+
return this.inEdgeMap.get(target) || [];
|
|
262
301
|
}
|
|
263
302
|
return [];
|
|
264
303
|
};
|
|
265
304
|
/**
|
|
266
|
-
* The function `outgoingEdgesOf` returns an array of outgoing edges from a given vertex or vertex ID.
|
|
267
|
-
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can
|
|
268
|
-
*
|
|
269
|
-
* @returns The method `outgoingEdgesOf` returns an array of
|
|
305
|
+
* The function `outgoingEdgesOf` returns an array of outgoing directed edges from a given vertex or vertex ID.
|
|
306
|
+
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a `V`
|
|
307
|
+
* object or a `VertexId`.
|
|
308
|
+
* @returns The method `outgoingEdgesOf` returns an array of `E` objects.
|
|
270
309
|
*/
|
|
271
310
|
DirectedGraph.prototype.outgoingEdgesOf = function (vertexOrId) {
|
|
272
|
-
var target = this.
|
|
311
|
+
var target = this._getVertex(vertexOrId);
|
|
273
312
|
if (target) {
|
|
274
313
|
return this._outEdgeMap.get(target) || [];
|
|
275
314
|
}
|
|
276
315
|
return [];
|
|
277
316
|
};
|
|
278
317
|
/**
|
|
279
|
-
* The function "degreeOf" returns the total degree of a vertex, which is the sum of its out-degree
|
|
280
|
-
*
|
|
281
|
-
* @
|
|
318
|
+
* The function "degreeOf" returns the total degree of a vertex in a directed graph, which is the sum of its out-degree
|
|
319
|
+
* and in-degree.
|
|
320
|
+
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
321
|
+
* `V`.
|
|
322
|
+
* @returns The sum of the out-degree and in-degree of the given vertex or vertex ID.
|
|
282
323
|
*/
|
|
283
324
|
DirectedGraph.prototype.degreeOf = function (vertexOrId) {
|
|
284
325
|
return this.outDegreeOf(vertexOrId) + this.inDegreeOf(vertexOrId);
|
|
285
326
|
};
|
|
286
327
|
/**
|
|
287
|
-
* The function "inDegreeOf" returns the number of incoming edges for a given vertex.
|
|
288
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
328
|
+
* The function "inDegreeOf" returns the number of incoming edges for a given vertex or vertex ID in a directed graph.
|
|
329
|
+
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
330
|
+
* `V`.
|
|
289
331
|
* @returns The number of incoming edges of the specified vertex or vertex ID.
|
|
290
332
|
*/
|
|
291
333
|
DirectedGraph.prototype.inDegreeOf = function (vertexOrId) {
|
|
292
334
|
return this.incomingEdgesOf(vertexOrId).length;
|
|
293
335
|
};
|
|
294
336
|
/**
|
|
295
|
-
* The function
|
|
296
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
337
|
+
* The function "outDegreeOf" returns the number of outgoing edges from a given vertex.
|
|
338
|
+
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
339
|
+
* `V`.
|
|
297
340
|
* @returns The number of outgoing edges from the specified vertex or vertex ID.
|
|
298
341
|
*/
|
|
299
342
|
DirectedGraph.prototype.outDegreeOf = function (vertexOrId) {
|
|
300
343
|
return this.outgoingEdgesOf(vertexOrId).length;
|
|
301
344
|
};
|
|
302
345
|
/**
|
|
303
|
-
* The function "edgesOf" returns an array of both outgoing and incoming edges of a given vertex or vertex ID.
|
|
304
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
305
|
-
*
|
|
346
|
+
* The function "edgesOf" returns an array of both outgoing and incoming directed edges of a given vertex or vertex ID.
|
|
347
|
+
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a
|
|
348
|
+
* `V`.
|
|
349
|
+
* @returns an array of directed edges.
|
|
306
350
|
*/
|
|
307
351
|
DirectedGraph.prototype.edgesOf = function (vertexOrId) {
|
|
308
352
|
return __spreadArray(__spreadArray([], __read(this.outgoingEdgesOf(vertexOrId)), false), __read(this.incomingEdgesOf(vertexOrId)), false);
|
|
309
353
|
};
|
|
310
354
|
/**
|
|
311
|
-
* The function "getEdgeSrc" returns the source vertex of
|
|
312
|
-
* @param
|
|
313
|
-
* @returns
|
|
355
|
+
* The function "getEdgeSrc" returns the source vertex of a directed edge, or null if the edge does not exist.
|
|
356
|
+
* @param e - A directed edge object of type E.
|
|
357
|
+
* @returns either a DirectedVertex object or null.
|
|
314
358
|
*/
|
|
315
359
|
DirectedGraph.prototype.getEdgeSrc = function (e) {
|
|
316
|
-
return this.
|
|
360
|
+
return this._getVertex(e.src);
|
|
317
361
|
};
|
|
318
362
|
/**
|
|
319
|
-
* The function "getEdgeDest" returns the vertex
|
|
320
|
-
* @param
|
|
321
|
-
*
|
|
363
|
+
* The function "getEdgeDest" returns the destination vertex of a directed edge.
|
|
364
|
+
* @param e - E - This is an object representing a directed edge in a graph. It contains information
|
|
365
|
+
* about the source vertex, destination vertex, and any associated data.
|
|
366
|
+
* @returns either a DirectedVertex object or null.
|
|
322
367
|
*/
|
|
323
368
|
DirectedGraph.prototype.getEdgeDest = function (e) {
|
|
324
|
-
return this.
|
|
369
|
+
return this._getVertex(e.dest);
|
|
325
370
|
};
|
|
326
371
|
/**
|
|
327
|
-
* The function `getDestinations` returns an array of
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* @returns an array of vertices (V[]).
|
|
372
|
+
* The function `getDestinations` returns an array of directed vertices that are the destinations of outgoing edges
|
|
373
|
+
* from a given vertex.
|
|
374
|
+
* @param {V | VertexId | null} vertex - The `vertex` parameter can be one of the following:
|
|
375
|
+
* @returns an array of DirectedVertex objects.
|
|
332
376
|
*/
|
|
333
377
|
DirectedGraph.prototype.getDestinations = function (vertex) {
|
|
334
378
|
var e_1, _a;
|
|
@@ -355,14 +399,11 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
355
399
|
}
|
|
356
400
|
return destinations;
|
|
357
401
|
};
|
|
358
|
-
/**--- start find cycles --- */
|
|
359
402
|
/**
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
* The `topologicalSort`
|
|
363
|
-
* order, or null if
|
|
364
|
-
* @returns The function `topologicalSort()` returns an array of vertices in topological order if there is no cycle in
|
|
365
|
-
* the graph. If there is a cycle, it returns `null`.
|
|
403
|
+
* The `topologicalSort` function performs a topological sort on a directed graph and returns the sorted vertices in
|
|
404
|
+
* reverse order, or null if the graph contains a cycle.
|
|
405
|
+
* @returns The function `topologicalSort()` returns an array of `V` or `VertexId` objects in
|
|
406
|
+
* topological order, or `null` if there is a cycle in the graph.
|
|
366
407
|
*/
|
|
367
408
|
DirectedGraph.prototype.topologicalSort = function () {
|
|
368
409
|
var e_2, _a, e_3, _b;
|
|
@@ -371,7 +412,7 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
371
412
|
// When judging whether there is a cycle in the directed graph, all nodes with **in degree = 0** are enqueued
|
|
372
413
|
var statusMap = new Map();
|
|
373
414
|
try {
|
|
374
|
-
for (var _c = __values(this.
|
|
415
|
+
for (var _c = __values(this.vertices), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
375
416
|
var entry = _d.value;
|
|
376
417
|
statusMap.set(entry[1], 0);
|
|
377
418
|
}
|
|
@@ -412,7 +453,7 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
412
453
|
sorted.push(cur);
|
|
413
454
|
};
|
|
414
455
|
try {
|
|
415
|
-
for (var _e = __values(this.
|
|
456
|
+
for (var _e = __values(this.vertices), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
416
457
|
var entry = _f.value;
|
|
417
458
|
if (statusMap.get(entry[1]) === 0) {
|
|
418
459
|
dfs(entry[1]);
|
|
@@ -430,10 +471,9 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
430
471
|
return null;
|
|
431
472
|
return sorted.reverse();
|
|
432
473
|
};
|
|
433
|
-
/**--- end find cycles --- */
|
|
434
474
|
/**
|
|
435
|
-
* The `edgeSet` function returns an array of all
|
|
436
|
-
* @returns The `edgeSet()` method returns an array of
|
|
475
|
+
* The `edgeSet` function returns an array of all directed edges in the graph.
|
|
476
|
+
* @returns The `edgeSet()` method returns an array of `E` objects.
|
|
437
477
|
*/
|
|
438
478
|
DirectedGraph.prototype.edgeSet = function () {
|
|
439
479
|
var edges = [];
|
|
@@ -442,22 +482,23 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
442
482
|
});
|
|
443
483
|
return edges;
|
|
444
484
|
};
|
|
485
|
+
/**--- start find cycles --- */
|
|
445
486
|
/**
|
|
446
|
-
* The function `getNeighbors` returns an array of neighboring vertices
|
|
447
|
-
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a
|
|
448
|
-
*
|
|
449
|
-
* @returns an array of
|
|
487
|
+
* The function `getNeighbors` returns an array of neighboring vertices of a given vertex in a directed graph.
|
|
488
|
+
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a `V`
|
|
489
|
+
* object or a `VertexId`.
|
|
490
|
+
* @returns an array of DirectedVertex objects.
|
|
450
491
|
*/
|
|
451
492
|
DirectedGraph.prototype.getNeighbors = function (vertexOrId) {
|
|
452
493
|
var e_5, _a;
|
|
453
494
|
var neighbors = [];
|
|
454
|
-
var vertex = this.
|
|
495
|
+
var vertex = this._getVertex(vertexOrId);
|
|
455
496
|
if (vertex) {
|
|
456
497
|
var outEdges = this.outgoingEdgesOf(vertex);
|
|
457
498
|
try {
|
|
458
499
|
for (var outEdges_1 = __values(outEdges), outEdges_1_1 = outEdges_1.next(); !outEdges_1_1.done; outEdges_1_1 = outEdges_1.next()) {
|
|
459
500
|
var outEdge = outEdges_1_1.value;
|
|
460
|
-
var neighbor = this.
|
|
501
|
+
var neighbor = this._getVertex(outEdge.dest);
|
|
461
502
|
// TODO after no-non-null-assertion not ensure the logic
|
|
462
503
|
if (neighbor) {
|
|
463
504
|
neighbors.push(neighbor);
|
|
@@ -474,19 +515,20 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
474
515
|
}
|
|
475
516
|
return neighbors;
|
|
476
517
|
};
|
|
518
|
+
/**--- end find cycles --- */
|
|
477
519
|
/**
|
|
478
|
-
* The function "getEndsOfEdge" returns the source and destination vertices of
|
|
479
|
-
* otherwise it returns null.
|
|
480
|
-
* @param
|
|
481
|
-
* @returns an array containing
|
|
482
|
-
*
|
|
520
|
+
* The function "getEndsOfEdge" returns the source and destination vertices of a directed edge if it exists in the
|
|
521
|
+
* graph, otherwise it returns null.
|
|
522
|
+
* @param edge - A directed edge object with a generic type E.
|
|
523
|
+
* @returns an array containing the starting and ending vertices of the given directed edge, or null if the edge does
|
|
524
|
+
* not exist in the graph.
|
|
483
525
|
*/
|
|
484
526
|
DirectedGraph.prototype.getEndsOfEdge = function (edge) {
|
|
485
527
|
if (!this.hasEdge(edge.src, edge.dest)) {
|
|
486
528
|
return null;
|
|
487
529
|
}
|
|
488
|
-
var v1 = this.
|
|
489
|
-
var v2 = this.
|
|
530
|
+
var v1 = this._getVertex(edge.src);
|
|
531
|
+
var v2 = this._getVertex(edge.dest);
|
|
490
532
|
if (v1 && v2) {
|
|
491
533
|
return [v1, v2];
|
|
492
534
|
}
|
|
@@ -494,6 +536,12 @@ var DirectedGraph = /** @class */ (function (_super) {
|
|
|
494
536
|
return null;
|
|
495
537
|
}
|
|
496
538
|
};
|
|
539
|
+
DirectedGraph.prototype._setOutEdgeMap = function (value) {
|
|
540
|
+
this._outEdgeMap = value;
|
|
541
|
+
};
|
|
542
|
+
DirectedGraph.prototype._setInEdgeMap = function (value) {
|
|
543
|
+
this._inEdgeMap = value;
|
|
544
|
+
};
|
|
497
545
|
return DirectedGraph;
|
|
498
546
|
}(abstract_graph_1.AbstractGraph));
|
|
499
547
|
exports.DirectedGraph = DirectedGraph;
|