data-structure-typed 1.21.3 → 1.31.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/.auto-changelog +9 -0
- package/.auto-changelog-template.hbs +36 -0
- package/.eslintrc.js +61 -0
- package/.github/workflows/ci.yml +30 -0
- package/.prettierignore +6 -0
- package/.prettierrc.js +16 -0
- package/CHANGELOG.md +17 -0
- package/README.md +150 -98
- package/dist/data-structures/binary-tree/aa-tree.js +6 -2
- package/dist/data-structures/binary-tree/aa-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +398 -672
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/avl-tree.js +122 -151
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/b-tree.js +6 -2
- package/dist/data-structures/binary-tree/b-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +24 -54
- package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/binary-tree.js +31 -32
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/bst.js +266 -208
- package/dist/data-structures/binary-tree/bst.js.map +1 -0
- package/dist/data-structures/binary-tree/index.js +1 -0
- package/dist/data-structures/binary-tree/index.js.map +1 -0
- package/dist/data-structures/binary-tree/rb-tree.js +46 -37
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/segment-tree.js +124 -127
- package/dist/data-structures/binary-tree/segment-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/splay-tree.js +6 -2
- package/dist/data-structures/binary-tree/splay-tree.js.map +1 -0
- package/dist/data-structures/binary-tree/tree-multiset.js +227 -354
- package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -0
- package/dist/data-structures/binary-tree/two-three-tree.js +6 -2
- package/dist/data-structures/binary-tree/two-three-tree.js.map +1 -0
- package/dist/data-structures/graph/abstract-graph.js +582 -609
- package/dist/data-structures/graph/abstract-graph.js.map +1 -0
- package/dist/data-structures/graph/directed-graph.js +276 -312
- package/dist/data-structures/graph/directed-graph.js.map +1 -0
- package/dist/data-structures/graph/index.js +1 -0
- package/dist/data-structures/graph/index.js.map +1 -0
- package/dist/data-structures/graph/map-graph.js +88 -100
- package/dist/data-structures/graph/map-graph.js.map +1 -0
- package/dist/data-structures/graph/undirected-graph.js +180 -195
- package/dist/data-structures/graph/undirected-graph.js.map +1 -0
- package/dist/data-structures/hash/coordinate-map.js +46 -58
- package/dist/data-structures/hash/coordinate-map.js.map +1 -0
- package/dist/data-structures/hash/coordinate-set.js +43 -48
- package/dist/data-structures/hash/coordinate-set.js.map +1 -0
- package/dist/data-structures/hash/hash-table.js +6 -2
- package/dist/data-structures/hash/hash-table.js.map +1 -0
- package/dist/data-structures/hash/index.js +1 -0
- package/dist/data-structures/hash/index.js.map +1 -0
- package/dist/data-structures/hash/pair.js +6 -2
- package/dist/data-structures/hash/pair.js.map +1 -0
- package/dist/data-structures/hash/tree-map.js +6 -2
- package/dist/data-structures/hash/tree-map.js.map +1 -0
- package/dist/data-structures/hash/tree-set.js +6 -2
- package/dist/data-structures/hash/tree-set.js.map +1 -0
- package/dist/data-structures/heap/heap.js +83 -120
- package/dist/data-structures/heap/heap.js.map +1 -0
- package/dist/data-structures/heap/index.js +1 -0
- package/dist/data-structures/heap/index.js.map +1 -0
- package/dist/data-structures/heap/max-heap.js +27 -24
- package/dist/data-structures/heap/max-heap.js.map +1 -0
- package/dist/data-structures/heap/min-heap.js +27 -25
- package/dist/data-structures/heap/min-heap.js.map +1 -0
- package/dist/data-structures/index.js +1 -0
- package/dist/data-structures/index.js.map +1 -0
- package/dist/data-structures/linked-list/doubly-linked-list.js +202 -307
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +1 -0
- package/dist/data-structures/linked-list/index.js +1 -0
- package/dist/data-structures/linked-list/index.js.map +1 -0
- package/dist/data-structures/linked-list/singly-linked-list.js +223 -251
- package/dist/data-structures/linked-list/singly-linked-list.js.map +1 -0
- package/dist/data-structures/linked-list/skip-linked-list.js +6 -2
- package/dist/data-structures/linked-list/skip-linked-list.js.map +1 -0
- package/dist/data-structures/matrix/index.js +1 -0
- package/dist/data-structures/matrix/index.js.map +1 -0
- package/dist/data-structures/matrix/matrix.js +9 -22
- package/dist/data-structures/matrix/matrix.js.map +1 -0
- package/dist/data-structures/matrix/matrix2d.js +75 -149
- package/dist/data-structures/matrix/matrix2d.js.map +1 -0
- package/dist/data-structures/matrix/navigator.js +38 -46
- package/dist/data-structures/matrix/navigator.js.map +1 -0
- package/dist/data-structures/matrix/vector2d.js +90 -254
- package/dist/data-structures/matrix/vector2d.js.map +1 -0
- package/dist/data-structures/priority-queue/index.js +1 -0
- package/dist/data-structures/priority-queue/index.js.map +1 -0
- package/dist/data-structures/priority-queue/max-priority-queue.js +47 -32
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -0
- package/dist/data-structures/priority-queue/min-priority-queue.js +47 -33
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -0
- package/dist/data-structures/priority-queue/priority-queue.js +150 -241
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -0
- package/dist/data-structures/queue/deque.js +130 -162
- package/dist/data-structures/queue/deque.js.map +1 -0
- package/dist/data-structures/queue/index.js +1 -0
- package/dist/data-structures/queue/index.js.map +1 -0
- package/dist/data-structures/queue/queue.js +181 -100
- package/dist/data-structures/queue/queue.js.map +1 -0
- package/dist/data-structures/stack/index.js +1 -0
- package/dist/data-structures/stack/index.js.map +1 -0
- package/dist/data-structures/stack/stack.js +23 -71
- package/dist/data-structures/stack/stack.js.map +1 -0
- package/dist/data-structures/tree/index.js +1 -0
- package/dist/data-structures/tree/index.js.map +1 -0
- package/dist/data-structures/tree/tree.js +46 -33
- package/dist/data-structures/tree/tree.js.map +1 -0
- package/dist/data-structures/trie/index.js +1 -0
- package/dist/data-structures/trie/index.js.map +1 -0
- package/dist/data-structures/trie/trie.js +201 -129
- package/dist/data-structures/trie/trie.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/abstract-binary-tree.js +1 -0
- package/dist/interfaces/abstract-binary-tree.js.map +1 -0
- package/dist/interfaces/abstract-graph.js +1 -0
- package/dist/interfaces/abstract-graph.js.map +1 -0
- package/dist/interfaces/avl-tree.js +1 -0
- package/dist/interfaces/avl-tree.js.map +1 -0
- package/dist/interfaces/binary-tree.js +1 -0
- package/dist/interfaces/binary-tree.js.map +1 -0
- package/dist/interfaces/bst.js +1 -0
- package/dist/interfaces/bst.js.map +1 -0
- package/dist/interfaces/directed-graph.js +1 -0
- package/dist/interfaces/directed-graph.js.map +1 -0
- package/dist/interfaces/doubly-linked-list.js +1 -0
- package/dist/interfaces/doubly-linked-list.js.map +1 -0
- package/dist/interfaces/heap.js +1 -0
- package/dist/interfaces/heap.js.map +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/navigator.js +1 -0
- package/dist/interfaces/navigator.js.map +1 -0
- package/dist/interfaces/priority-queue.js +1 -0
- package/dist/interfaces/priority-queue.js.map +1 -0
- package/dist/interfaces/rb-tree.js +1 -0
- package/dist/interfaces/rb-tree.js.map +1 -0
- package/dist/interfaces/segment-tree.js +1 -0
- package/dist/interfaces/segment-tree.js.map +1 -0
- package/dist/interfaces/singly-linked-list.js +1 -0
- package/dist/interfaces/singly-linked-list.js.map +1 -0
- package/dist/interfaces/tree-multiset.js +1 -0
- package/dist/interfaces/tree-multiset.js.map +1 -0
- package/dist/interfaces/undirected-graph.js +1 -0
- package/dist/interfaces/undirected-graph.js.map +1 -0
- package/dist/types/data-structures/abstract-binary-tree.js +1 -7
- package/dist/types/data-structures/abstract-binary-tree.js.map +1 -0
- package/dist/types/data-structures/abstract-graph.js +1 -0
- package/dist/types/data-structures/abstract-graph.js.map +1 -0
- package/dist/types/data-structures/avl-tree.js +1 -0
- package/dist/types/data-structures/avl-tree.js.map +1 -0
- package/dist/types/data-structures/binary-tree.js +1 -0
- package/dist/types/data-structures/binary-tree.js.map +1 -0
- package/dist/types/data-structures/bst.js +1 -0
- package/dist/types/data-structures/bst.js.map +1 -0
- package/dist/types/data-structures/directed-graph.js +1 -0
- package/dist/types/data-structures/directed-graph.js.map +1 -0
- package/dist/types/data-structures/doubly-linked-list.js +1 -0
- package/dist/types/data-structures/doubly-linked-list.js.map +1 -0
- package/dist/types/data-structures/heap.js +1 -0
- package/dist/types/data-structures/heap.js.map +1 -0
- package/dist/types/data-structures/index.js +1 -0
- package/dist/types/data-structures/index.js.map +1 -0
- package/dist/types/data-structures/map-graph.js +1 -0
- package/dist/types/data-structures/map-graph.js.map +1 -0
- package/dist/types/data-structures/navigator.js +1 -0
- package/dist/types/data-structures/navigator.js.map +1 -0
- package/dist/types/data-structures/priority-queue.js +1 -0
- package/dist/types/data-structures/priority-queue.js.map +1 -0
- package/dist/types/data-structures/rb-tree.js +1 -0
- package/dist/types/data-structures/rb-tree.js.map +1 -0
- package/dist/types/data-structures/segment-tree.js +1 -0
- package/dist/types/data-structures/segment-tree.js.map +1 -0
- package/dist/types/data-structures/singly-linked-list.js +1 -0
- package/dist/types/data-structures/singly-linked-list.js.map +1 -0
- package/dist/types/data-structures/tree-multiset.js +1 -0
- package/dist/types/data-structures/tree-multiset.js.map +1 -0
- package/dist/types/helpers.js +1 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/utils/index.js +1 -0
- package/dist/types/utils/index.js.map +1 -0
- package/dist/types/utils/utils.js +1 -0
- package/dist/types/utils/utils.js.map +1 -0
- package/dist/types/utils/validate-type.js +1 -0
- package/dist/types/utils/validate-type.js.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.js +108 -22
- package/dist/utils/utils.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +127 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/classes/AVLTree.html +2259 -0
- package/docs/classes/AVLTreeNode.html +399 -0
- package/docs/classes/AaTree.html +202 -0
- package/docs/classes/AbstractBinaryTree.html +1913 -0
- package/docs/classes/AbstractBinaryTreeNode.html +441 -0
- package/docs/classes/AbstractEdge.html +345 -0
- package/docs/classes/AbstractGraph.html +1105 -0
- package/docs/classes/AbstractVertex.html +299 -0
- package/docs/classes/ArrayDeque.html +469 -0
- package/docs/classes/BST.html +2103 -0
- package/docs/classes/BSTNode.html +400 -0
- package/docs/classes/BTree.html +202 -0
- package/docs/classes/BinaryIndexedTree.html +371 -0
- package/docs/classes/BinaryTree.html +1944 -0
- package/docs/classes/BinaryTreeNode.html +399 -0
- package/docs/classes/Character.html +250 -0
- package/docs/classes/CoordinateMap.html +513 -0
- package/docs/classes/CoordinateSet.html +474 -0
- package/docs/classes/Deque.html +1005 -0
- package/docs/classes/DirectedEdge.html +404 -0
- package/docs/classes/DirectedGraph.html +1530 -0
- package/docs/classes/DirectedVertex.html +286 -0
- package/docs/classes/DoublyLinkedList.html +998 -0
- package/docs/classes/DoublyLinkedListNode.html +327 -0
- package/docs/classes/HashTable.html +202 -0
- package/docs/classes/Heap.html +647 -0
- package/docs/classes/HeapItem.html +296 -0
- package/docs/classes/LinkedListQueue.html +884 -0
- package/docs/classes/MapEdge.html +391 -0
- package/docs/classes/MapGraph.html +1583 -0
- package/docs/classes/MapVertex.html +356 -0
- package/docs/classes/Matrix2D.html +532 -0
- package/docs/classes/MatrixNTI2D.html +270 -0
- package/docs/classes/MaxHeap.html +671 -0
- package/docs/classes/MaxPriorityQueue.html +866 -0
- package/docs/classes/MinHeap.html +672 -0
- package/docs/classes/MinPriorityQueue.html +868 -0
- package/docs/classes/Navigator.html +343 -0
- package/docs/classes/ObjectDeque.html +527 -0
- package/docs/classes/Pair.html +202 -0
- package/docs/classes/PriorityQueue.html +790 -0
- package/docs/classes/Queue.html +521 -0
- package/docs/classes/RBTree.html +2101 -0
- package/docs/classes/RBTreeNode.html +431 -0
- package/docs/classes/SegmentTree.html +464 -0
- package/docs/classes/SegmentTreeNode.html +387 -0
- package/docs/classes/SinglyLinkedList.html +830 -0
- package/docs/classes/SinglyLinkedListNode.html +300 -0
- package/docs/classes/SkipLinkedList.html +202 -0
- package/docs/classes/SplayTree.html +202 -0
- package/docs/classes/Stack.html +398 -0
- package/docs/classes/TreeMap.html +202 -0
- package/docs/classes/TreeMultiset.html +2587 -0
- package/docs/classes/TreeMultisetNode.html +447 -0
- package/docs/classes/TreeNode.html +344 -0
- package/docs/classes/TreeSet.html +202 -0
- package/docs/classes/Trie.html +402 -0
- package/docs/classes/TrieNode.html +310 -0
- package/docs/classes/TwoThreeTree.html +202 -0
- package/docs/classes/UndirectedEdge.html +374 -0
- package/docs/classes/UndirectedGraph.html +1285 -0
- package/docs/classes/UndirectedVertex.html +284 -0
- package/docs/classes/Vector2D.html +835 -0
- package/docs/enums/CP.html +211 -0
- package/docs/enums/FamilyPosition.html +239 -0
- package/docs/enums/LoopType.html +212 -0
- package/docs/enums/RBColor.html +204 -0
- package/docs/enums/TopologicalProperty.html +211 -0
- package/docs/functions/arrayRemove.html +208 -0
- package/docs/functions/isThunk.html +186 -0
- package/docs/functions/toThunk.html +186 -0
- package/docs/functions/trampoline.html +186 -0
- package/docs/functions/trampolineAsync.html +186 -0
- package/docs/functions/uuidV4.html +181 -0
- package/docs/index.html +693 -0
- package/docs/interfaces/IAVLTree.html +1245 -0
- package/docs/interfaces/IAbstractBinaryTree.html +1101 -0
- package/docs/interfaces/IAbstractBinaryTreeNode.html +335 -0
- package/docs/interfaces/IAbstractGraph.html +433 -0
- package/docs/interfaces/IBST.html +1245 -0
- package/docs/interfaces/IDirectedGraph.html +570 -0
- package/docs/interfaces/IRBTree.html +1247 -0
- package/docs/interfaces/IUNDirectedGraph.html +463 -0
- package/docs/modules.html +328 -0
- package/docs/types/AVLTreeNodeNested.html +182 -0
- package/docs/types/AVLTreeOptions.html +180 -0
- package/docs/types/AbstractBinaryTreeNodeNested.html +182 -0
- package/docs/types/AbstractBinaryTreeNodeProperties.html +182 -0
- package/docs/types/AbstractBinaryTreeNodeProperty.html +182 -0
- package/docs/types/AbstractBinaryTreeOptions.html +182 -0
- package/docs/types/BSTComparator.html +192 -0
- package/docs/types/BSTNodeNested.html +182 -0
- package/docs/types/BSTOptions.html +182 -0
- package/docs/types/BinaryTreeDeletedResult.html +189 -0
- package/docs/types/BinaryTreeNodeId.html +177 -0
- package/docs/types/BinaryTreeNodeNested.html +182 -0
- package/docs/types/BinaryTreeNodePropertyName.html +177 -0
- package/docs/types/BinaryTreeOptions.html +180 -0
- package/docs/types/DFSOrderPattern.html +177 -0
- package/docs/types/DijkstraResult.html +199 -0
- package/docs/types/Direction.html +177 -0
- package/docs/types/DummyAny.html +190 -0
- package/docs/types/EdgeId.html +177 -0
- package/docs/types/HeapOptions.html +198 -0
- package/docs/types/IAVLTreeNode.html +184 -0
- package/docs/types/IBSTNode.html +184 -0
- package/docs/types/IBinaryTree.html +182 -0
- package/docs/types/IBinaryTreeNode.html +184 -0
- package/docs/types/IRBTreeNode.html +184 -0
- package/docs/types/ITreeMultiset.html +182 -0
- package/docs/types/ITreeMultisetNode.html +184 -0
- package/docs/types/KeyValueObject.html +182 -0
- package/docs/types/KeyValueObjectWithId.html +184 -0
- package/docs/types/MapGraphCoordinate.html +177 -0
- package/docs/types/NavigatorParams.html +211 -0
- package/docs/types/NodeOrPropertyName.html +177 -0
- package/docs/types/NonNumberNonObjectButDefined.html +177 -0
- package/docs/types/ObjectWithNonNumberId.html +184 -0
- package/docs/types/ObjectWithNumberId.html +184 -0
- package/docs/types/ObjectWithoutId.html +177 -0
- package/docs/types/PriorityQueueComparator.html +197 -0
- package/docs/types/PriorityQueueDFSOrderPattern.html +177 -0
- package/docs/types/PriorityQueueOptions.html +191 -0
- package/docs/types/RBTreeNodeNested.html +182 -0
- package/docs/types/RBTreeOptions.html +180 -0
- package/docs/types/RestrictValById.html +177 -0
- package/docs/types/SegmentTreeNodeVal.html +177 -0
- package/docs/types/SpecifyOptional.html +184 -0
- package/docs/types/Thunk.html +185 -0
- package/docs/types/ToThunkFn.html +185 -0
- package/docs/types/TopologicalStatus.html +177 -0
- package/docs/types/TreeMultisetNodeNested.html +182 -0
- package/docs/types/TreeMultisetOptions.html +180 -0
- package/docs/types/TrlAsyncFn.html +190 -0
- package/docs/types/TrlFn.html +190 -0
- package/docs/types/Turning.html +177 -0
- package/docs/types/VertexId.html +177 -0
- package/docs/variables/THUNK_SYMBOL.html +177 -0
- package/jest.config.js +5 -0
- package/lib/data-structures/binary-tree/aa-tree.js +2 -0
- package/{dist → lib}/data-structures/binary-tree/abstract-binary-tree.d.ts +25 -20
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +1307 -0
- package/{dist → lib}/data-structures/binary-tree/avl-tree.d.ts +12 -12
- package/lib/data-structures/binary-tree/avl-tree.js +311 -0
- package/lib/data-structures/binary-tree/b-tree.js +2 -0
- package/lib/data-structures/binary-tree/binary-indexed-tree.js +69 -0
- package/lib/data-structures/binary-tree/binary-tree.js +35 -0
- package/{dist → lib}/data-structures/binary-tree/bst.d.ts +19 -8
- package/lib/data-structures/binary-tree/bst.js +551 -0
- package/lib/data-structures/binary-tree/index.js +12 -0
- package/{dist → lib}/data-structures/binary-tree/rb-tree.d.ts +0 -6
- package/lib/data-structures/binary-tree/rb-tree.js +22 -0
- package/lib/data-structures/binary-tree/segment-tree.js +210 -0
- package/lib/data-structures/binary-tree/splay-tree.js +2 -0
- package/{dist → lib}/data-structures/binary-tree/tree-multiset.d.ts +20 -23
- package/lib/data-structures/binary-tree/tree-multiset.js +673 -0
- package/lib/data-structures/binary-tree/two-three-tree.js +2 -0
- package/lib/data-structures/graph/abstract-graph.js +918 -0
- package/lib/data-structures/graph/directed-graph.js +416 -0
- package/lib/data-structures/graph/index.js +4 -0
- package/lib/data-structures/graph/map-graph.js +105 -0
- package/lib/data-structures/graph/undirected-graph.js +246 -0
- package/lib/data-structures/hash/coordinate-map.js +61 -0
- package/lib/data-structures/hash/coordinate-set.js +51 -0
- package/lib/data-structures/hash/hash-table.js +2 -0
- package/lib/data-structures/hash/index.js +6 -0
- package/lib/data-structures/hash/pair.js +2 -0
- package/lib/data-structures/hash/tree-map.js +2 -0
- package/lib/data-structures/hash/tree-set.js +2 -0
- package/lib/data-structures/heap/heap.js +152 -0
- package/lib/data-structures/heap/index.js +3 -0
- package/lib/data-structures/heap/max-heap.js +26 -0
- package/lib/data-structures/heap/min-heap.js +27 -0
- package/lib/data-structures/index.js +11 -0
- package/{dist → lib}/data-structures/linked-list/doubly-linked-list.d.ts +5 -5
- package/lib/data-structures/linked-list/doubly-linked-list.js +521 -0
- package/lib/data-structures/linked-list/index.js +3 -0
- package/{dist → lib}/data-structures/linked-list/singly-linked-list.d.ts +6 -5
- package/lib/data-structures/linked-list/singly-linked-list.js +443 -0
- package/lib/data-structures/linked-list/skip-linked-list.js +2 -0
- package/lib/data-structures/matrix/index.js +4 -0
- package/lib/data-structures/matrix/matrix.js +24 -0
- package/lib/data-structures/matrix/matrix2d.js +195 -0
- package/lib/data-structures/matrix/navigator.js +101 -0
- package/lib/data-structures/matrix/vector2d.js +287 -0
- package/lib/data-structures/priority-queue/index.js +3 -0
- package/lib/data-structures/priority-queue/max-priority-queue.js +39 -0
- package/lib/data-structures/priority-queue/min-priority-queue.js +40 -0
- package/lib/data-structures/priority-queue/priority-queue.js +317 -0
- package/{dist → lib}/data-structures/queue/deque.d.ts +45 -0
- package/lib/data-structures/queue/deque.js +270 -0
- package/lib/data-structures/queue/index.js +2 -0
- package/{dist → lib}/data-structures/queue/queue.d.ts +47 -13
- package/lib/data-structures/queue/queue.js +165 -0
- package/lib/data-structures/stack/index.js +1 -0
- package/lib/data-structures/stack/stack.js +87 -0
- package/lib/data-structures/tree/index.js +1 -0
- package/lib/data-structures/tree/tree.js +56 -0
- package/lib/data-structures/trie/index.js +1 -0
- package/lib/data-structures/trie/trie.js +205 -0
- package/lib/index.js +4 -0
- package/{dist → lib}/interfaces/avl-tree.d.ts +1 -9
- package/lib/interfaces/binary-tree.d.ts +4 -0
- package/{dist → lib}/interfaces/bst.d.ts +1 -2
- package/lib/interfaces/heap.js +1 -0
- package/lib/interfaces/index.js +15 -0
- package/lib/interfaces/navigator.d.ts +1 -0
- package/lib/interfaces/navigator.js +1 -0
- package/lib/interfaces/priority-queue.d.ts +1 -0
- package/lib/interfaces/priority-queue.js +1 -0
- package/{dist → lib}/interfaces/rb-tree.d.ts +1 -2
- package/lib/interfaces/rb-tree.js +1 -0
- package/lib/interfaces/segment-tree.d.ts +1 -0
- package/lib/interfaces/segment-tree.js +1 -0
- package/lib/interfaces/singly-linked-list.d.ts +1 -0
- package/lib/interfaces/singly-linked-list.js +1 -0
- package/lib/interfaces/tree-multiset.d.ts +5 -0
- package/lib/interfaces/tree-multiset.js +1 -0
- package/lib/interfaces/undirected-graph.js +1 -0
- package/{dist → lib}/types/data-structures/abstract-binary-tree.d.ts +1 -1
- package/lib/types/data-structures/abstract-binary-tree.js +22 -0
- package/lib/types/data-structures/abstract-graph.js +1 -0
- package/{dist → lib}/types/data-structures/avl-tree.d.ts +1 -1
- package/lib/types/data-structures/avl-tree.js +1 -0
- package/lib/types/data-structures/binary-tree.js +1 -0
- package/lib/types/data-structures/bst.js +6 -0
- package/lib/types/data-structures/directed-graph.js +6 -0
- package/lib/types/data-structures/doubly-linked-list.d.ts +1 -0
- package/lib/types/data-structures/doubly-linked-list.js +1 -0
- package/lib/types/data-structures/heap.js +1 -0
- package/lib/types/data-structures/index.js +15 -0
- package/lib/types/data-structures/map-graph.js +1 -0
- package/lib/types/data-structures/navigator.js +1 -0
- package/lib/types/data-structures/priority-queue.js +1 -0
- package/lib/types/data-structures/rb-tree.js +5 -0
- package/lib/types/data-structures/segment-tree.js +1 -0
- package/lib/types/data-structures/singly-linked-list.d.ts +1 -0
- package/lib/types/data-structures/singly-linked-list.js +1 -0
- package/lib/types/data-structures/tree-multiset.js +1 -0
- package/lib/types/helpers.d.ts +1 -0
- package/lib/types/helpers.js +1 -0
- package/lib/types/index.js +3 -0
- package/lib/types/utils/index.js +2 -0
- package/{dist → lib}/types/utils/utils.d.ts +1 -1
- package/lib/types/utils/utils.js +1 -0
- package/{dist → lib}/types/utils/validate-type.d.ts +1 -1
- package/lib/types/utils/validate-type.js +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/utils.js +57 -0
- package/package.json +147 -56
- package/rename_clear_files.sh +29 -0
- package/test/integration/avl-tree.test.ts +111 -0
- package/test/integration/bst.test.ts +371 -0
- package/test/integration/heap.test.js +19 -0
- package/test/integration/index.html +44 -0
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +111 -0
- package/test/unit/data-structures/binary-tree/bst.test.ts +371 -0
- package/test/unit/data-structures/binary-tree/overall.test.ts +57 -0
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +405 -0
- package/test/unit/data-structures/graph/abstract-graph.test.ts +5 -0
- package/test/unit/data-structures/graph/directed-graph.test.ts +517 -0
- package/test/unit/data-structures/graph/index.ts +2 -0
- package/test/unit/data-structures/graph/map-graph.test.ts +46 -0
- package/test/unit/data-structures/graph/overall.test.ts +50 -0
- package/test/unit/data-structures/graph/undirected-graph.test.ts +60 -0
- package/test/unit/data-structures/heap/heap.test.ts +56 -0
- package/test/unit/data-structures/heap/max-heap.test.ts +42 -0
- package/test/unit/data-structures/heap/min-heap.test.ts +81 -0
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +365 -0
- package/test/unit/data-structures/linked-list/index.ts +4 -0
- package/test/unit/data-structures/linked-list/linked-list.test.ts +37 -0
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +401 -0
- package/test/unit/data-structures/linked-list/skip-linked-list.test.ts +13 -0
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +106 -0
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +105 -0
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +27 -0
- package/test/unit/data-structures/queue/queue.test.ts +36 -0
- package/test/utils/index.ts +2 -0
- package/test/utils/magnitude.ts +21 -0
- package/test/utils/number.ts +3 -0
- package/tsconfig.build.json +33 -0
- package/tsconfig.json +38 -0
- package/umd/bundle.min.js +3 -0
- package/umd/bundle.min.js.map +1 -0
- package/webpack.config.js +28 -0
- package/dist/bundle.js +0 -2
- package/dist/interfaces/binary-tree.d.ts +0 -6
- package/dist/interfaces/tree-multiset.d.ts +0 -7
- /package/{dist → lib}/data-structures/binary-tree/aa-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/b-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/binary-indexed-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/binary-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/segment-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/splay-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/binary-tree/two-three-tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/graph/abstract-graph.d.ts +0 -0
- /package/{dist → lib}/data-structures/graph/directed-graph.d.ts +0 -0
- /package/{dist → lib}/data-structures/graph/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/graph/map-graph.d.ts +0 -0
- /package/{dist → lib}/data-structures/graph/undirected-graph.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/coordinate-map.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/coordinate-set.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/hash-table.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/pair.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/tree-map.d.ts +0 -0
- /package/{dist → lib}/data-structures/hash/tree-set.d.ts +0 -0
- /package/{dist → lib}/data-structures/heap/heap.d.ts +0 -0
- /package/{dist → lib}/data-structures/heap/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/heap/max-heap.d.ts +0 -0
- /package/{dist → lib}/data-structures/heap/min-heap.d.ts +0 -0
- /package/{dist → lib}/data-structures/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/linked-list/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/linked-list/skip-linked-list.d.ts +0 -0
- /package/{dist → lib}/data-structures/matrix/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/matrix/matrix.d.ts +0 -0
- /package/{dist → lib}/data-structures/matrix/matrix2d.d.ts +0 -0
- /package/{dist → lib}/data-structures/matrix/navigator.d.ts +0 -0
- /package/{dist → lib}/data-structures/matrix/vector2d.d.ts +0 -0
- /package/{dist → lib}/data-structures/priority-queue/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/priority-queue/max-priority-queue.d.ts +0 -0
- /package/{dist → lib}/data-structures/priority-queue/min-priority-queue.d.ts +0 -0
- /package/{dist → lib}/data-structures/priority-queue/priority-queue.d.ts +0 -0
- /package/{dist → lib}/data-structures/queue/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/stack/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/stack/stack.d.ts +0 -0
- /package/{dist → lib}/data-structures/tree/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/tree/tree.d.ts +0 -0
- /package/{dist → lib}/data-structures/trie/index.d.ts +0 -0
- /package/{dist → lib}/data-structures/trie/trie.d.ts +0 -0
- /package/{dist → lib}/index.d.ts +0 -0
- /package/{dist → lib}/interfaces/abstract-binary-tree.d.ts +0 -0
- /package/{dist/interfaces/doubly-linked-list.d.ts → lib/interfaces/abstract-binary-tree.js} +0 -0
- /package/{dist → lib}/interfaces/abstract-graph.d.ts +0 -0
- /package/{dist/interfaces/heap.d.ts → lib/interfaces/abstract-graph.js} +0 -0
- /package/{dist/interfaces/navigator.d.ts → lib/interfaces/avl-tree.js} +0 -0
- /package/{dist/interfaces/priority-queue.d.ts → lib/interfaces/binary-tree.js} +0 -0
- /package/{dist/interfaces/segment-tree.d.ts → lib/interfaces/bst.js} +0 -0
- /package/{dist → lib}/interfaces/directed-graph.d.ts +0 -0
- /package/{dist/interfaces/singly-linked-list.d.ts → lib/interfaces/directed-graph.js} +0 -0
- /package/{dist/types/data-structures → lib/interfaces}/doubly-linked-list.d.ts +0 -0
- /package/{dist/types/data-structures/singly-linked-list.d.ts → lib/interfaces/doubly-linked-list.js} +0 -0
- /package/{dist/types/helpers.d.ts → lib/interfaces/heap.d.ts} +0 -0
- /package/{dist → lib}/interfaces/index.d.ts +0 -0
- /package/{dist → lib}/interfaces/undirected-graph.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/abstract-graph.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/binary-tree.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/bst.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/directed-graph.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/heap.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/index.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/map-graph.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/navigator.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/priority-queue.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/rb-tree.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/segment-tree.d.ts +0 -0
- /package/{dist → lib}/types/data-structures/tree-multiset.d.ts +0 -0
- /package/{dist → lib}/types/index.d.ts +0 -0
- /package/{dist → lib}/types/utils/index.d.ts +0 -0
- /package/{dist → lib}/utils/index.d.ts +0 -0
- /package/{dist → lib}/utils/utils.d.ts +0 -0
- /package/{dist/bundle.js.LICENSE.txt → umd/bundle.min.js.LICENSE.txt} +0 -0
|
@@ -1,405 +1,367 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.DirectedVertex = DirectedVertex;
|
|
26
|
-
class DirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
27
|
-
/**
|
|
28
|
-
* The constructor function initializes the source and destination vertices of an edge, along with an optional weight
|
|
29
|
-
* and value.
|
|
30
|
-
* @param {VertexId} src - The `src` parameter is the source vertex ID. It represents the starting point of an edge in
|
|
31
|
-
* a graph.
|
|
32
|
-
* @param {VertexId} dest - The `dest` parameter represents the destination vertex of an edge. It is of type
|
|
33
|
-
* `VertexId`, which is likely a unique identifier for a vertex in a graph.
|
|
34
|
-
* @param {number} [weight] - The weight parameter is an optional number that represents the weight of the edge.
|
|
35
|
-
* @param {T} [val] - The `val` parameter is an optional parameter of type `T`. It represents the value associated with
|
|
36
|
-
* the edge.
|
|
37
|
-
*/
|
|
38
|
-
constructor(src, dest, weight, val) {
|
|
39
|
-
super(weight, val);
|
|
40
|
-
this._src = src;
|
|
41
|
-
this._dest = dest;
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
+
if (!m) return o;
|
|
20
|
+
var i = m.call(o), r, ar = [], e;
|
|
21
|
+
try {
|
|
22
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
42
23
|
}
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
catch (error) { e = { error: error }; }
|
|
25
|
+
finally {
|
|
26
|
+
try {
|
|
27
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
+
}
|
|
29
|
+
finally { if (e) throw e.error; }
|
|
45
30
|
}
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
34
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
35
|
+
if (ar || !(i in from)) {
|
|
36
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
37
|
+
ar[i] = from[i];
|
|
38
|
+
}
|
|
48
39
|
}
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
|
+
};
|
|
42
|
+
var __values = (this && this.__values) || function(o) {
|
|
43
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
44
|
+
if (m) return m.call(o);
|
|
45
|
+
if (o && typeof o.length === "number") return {
|
|
46
|
+
next: function () {
|
|
47
|
+
if (o && i >= o.length) o = void 0;
|
|
48
|
+
return { value: o && o[i++], done: !o };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.DirectedGraph = exports.DirectedEdge = exports.DirectedVertex = void 0;
|
|
55
|
+
var utils_1 = require("../../utils");
|
|
56
|
+
var abstract_graph_1 = require("./abstract-graph");
|
|
57
|
+
var DirectedVertex = (function (_super) {
|
|
58
|
+
__extends(DirectedVertex, _super);
|
|
59
|
+
function DirectedVertex(id, val) {
|
|
60
|
+
return _super.call(this, id, val) || this;
|
|
51
61
|
}
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
return DirectedVertex;
|
|
63
|
+
}(abstract_graph_1.AbstractVertex));
|
|
64
|
+
exports.DirectedVertex = DirectedVertex;
|
|
65
|
+
var DirectedEdge = (function (_super) {
|
|
66
|
+
__extends(DirectedEdge, _super);
|
|
67
|
+
function DirectedEdge(src, dest, weight, val) {
|
|
68
|
+
var _this = _super.call(this, weight, val) || this;
|
|
69
|
+
_this._src = src;
|
|
70
|
+
_this._dest = dest;
|
|
71
|
+
return _this;
|
|
54
72
|
}
|
|
55
|
-
|
|
73
|
+
Object.defineProperty(DirectedEdge.prototype, "src", {
|
|
74
|
+
get: function () {
|
|
75
|
+
return this._src;
|
|
76
|
+
},
|
|
77
|
+
set: function (v) {
|
|
78
|
+
this._src = v;
|
|
79
|
+
},
|
|
80
|
+
enumerable: false,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(DirectedEdge.prototype, "dest", {
|
|
84
|
+
get: function () {
|
|
85
|
+
return this._dest;
|
|
86
|
+
},
|
|
87
|
+
set: function (v) {
|
|
88
|
+
this._dest = v;
|
|
89
|
+
},
|
|
90
|
+
enumerable: false,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
return DirectedEdge;
|
|
94
|
+
}(abstract_graph_1.AbstractEdge));
|
|
56
95
|
exports.DirectedEdge = DirectedEdge;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this._inEdgeMap = new Map();
|
|
65
|
-
}
|
|
66
|
-
get outEdgeMap() {
|
|
67
|
-
return this._outEdgeMap;
|
|
68
|
-
}
|
|
69
|
-
get inEdgeMap() {
|
|
70
|
-
return this._inEdgeMap;
|
|
96
|
+
var DirectedGraph = (function (_super) {
|
|
97
|
+
__extends(DirectedGraph, _super);
|
|
98
|
+
function DirectedGraph() {
|
|
99
|
+
var _this = _super.call(this) || this;
|
|
100
|
+
_this._outEdgeMap = new Map();
|
|
101
|
+
_this._inEdgeMap = new Map();
|
|
102
|
+
return _this;
|
|
71
103
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
104
|
+
Object.defineProperty(DirectedGraph.prototype, "outEdgeMap", {
|
|
105
|
+
get: function () {
|
|
106
|
+
return this._outEdgeMap;
|
|
107
|
+
},
|
|
108
|
+
enumerable: false,
|
|
109
|
+
configurable: true
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(DirectedGraph.prototype, "inEdgeMap", {
|
|
112
|
+
get: function () {
|
|
113
|
+
return this._inEdgeMap;
|
|
114
|
+
},
|
|
115
|
+
enumerable: false,
|
|
116
|
+
configurable: true
|
|
117
|
+
});
|
|
118
|
+
DirectedGraph.prototype.createVertex = function (id, val) {
|
|
86
119
|
return new DirectedVertex(id, val !== null && val !== void 0 ? val : id);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
* 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.
|
|
90
|
-
* 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.
|
|
91
|
-
*/
|
|
92
|
-
/**
|
|
93
|
-
* The function creates a directed edge between two vertices with an optional weight and value.
|
|
94
|
-
* @param {VertexId} src - The source vertex ID of the edge. It represents the starting point of the edge.
|
|
95
|
-
* @param {VertexId} dest - The `dest` parameter is the identifier of the destination vertex for the edge.
|
|
96
|
-
* @param {number} [weight] - The weight parameter is an optional number that represents the weight of the edge. If no
|
|
97
|
-
* weight is provided, it defaults to 1.
|
|
98
|
-
* @param [val] - The 'val' parameter is an optional value that can be assigned to the edge. It can be of any type and
|
|
99
|
-
* is used to store additional information or data associated with the edge.
|
|
100
|
-
* @returns a new instance of a DirectedEdge object, casted as type E.
|
|
101
|
-
*/
|
|
102
|
-
createEdge(src, dest, weight, val) {
|
|
120
|
+
};
|
|
121
|
+
DirectedGraph.prototype.createEdge = function (src, dest, weight, val) {
|
|
103
122
|
return new DirectedEdge(src, dest, weight !== null && weight !== void 0 ? weight : 1, val);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @param {V | null | VertexId} srcOrId - The source vertex or its ID. It can be either a vertex object or a vertex ID.
|
|
108
|
-
* @param {V | null | VertexId} destOrId - The `destOrId` parameter in the `getEdge` function represents the
|
|
109
|
-
* destination vertex of the edge. It can be either a vertex object (`V`), a vertex ID (`VertexId`), or `null` if the
|
|
110
|
-
* destination is not specified.
|
|
111
|
-
* @returns the first edge found between the source and destination vertices, or null if no such edge is found.
|
|
112
|
-
*/
|
|
113
|
-
getEdge(srcOrId, destOrId) {
|
|
114
|
-
let edges = [];
|
|
123
|
+
};
|
|
124
|
+
DirectedGraph.prototype.getEdge = function (srcOrId, destOrId) {
|
|
125
|
+
var edges = [];
|
|
115
126
|
if (srcOrId !== null && destOrId !== null) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (src &&
|
|
119
|
-
|
|
127
|
+
var src = this._getVertex(srcOrId);
|
|
128
|
+
var dest_1 = this._getVertex(destOrId);
|
|
129
|
+
if (src && dest_1) {
|
|
130
|
+
var srcOutEdges = this._outEdgeMap.get(src);
|
|
120
131
|
if (srcOutEdges) {
|
|
121
|
-
edges = srcOutEdges.filter(edge
|
|
132
|
+
edges = srcOutEdges.filter(function (edge) { return edge.dest === dest_1.id; });
|
|
122
133
|
}
|
|
123
134
|
}
|
|
124
135
|
}
|
|
125
136
|
return edges[0] || null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
* @returns the removed edge (E) if it exists, or null if either the source or destination vertex does not exist.
|
|
132
|
-
*/
|
|
133
|
-
removeEdgeSrcToDest(srcOrId, destOrId) {
|
|
134
|
-
const src = this._getVertex(srcOrId);
|
|
135
|
-
const dest = this._getVertex(destOrId);
|
|
136
|
-
let removed = null;
|
|
137
|
+
};
|
|
138
|
+
DirectedGraph.prototype.removeEdgeSrcToDest = function (srcOrId, destOrId) {
|
|
139
|
+
var src = this._getVertex(srcOrId);
|
|
140
|
+
var dest = this._getVertex(destOrId);
|
|
141
|
+
var removed = null;
|
|
137
142
|
if (!src || !dest) {
|
|
138
143
|
return null;
|
|
139
144
|
}
|
|
140
|
-
|
|
145
|
+
var srcOutEdges = this._outEdgeMap.get(src);
|
|
141
146
|
if (srcOutEdges) {
|
|
142
|
-
(0, utils_1.arrayRemove)(srcOutEdges, (edge)
|
|
147
|
+
(0, utils_1.arrayRemove)(srcOutEdges, function (edge) { return edge.dest === dest.id; });
|
|
143
148
|
}
|
|
144
|
-
|
|
149
|
+
var destInEdges = this._inEdgeMap.get(dest);
|
|
145
150
|
if (destInEdges) {
|
|
146
|
-
removed = (0, utils_1.arrayRemove)(destInEdges, (edge)
|
|
151
|
+
removed = (0, utils_1.arrayRemove)(destInEdges, function (edge) { return edge.src === src.id; })[0] || null;
|
|
147
152
|
}
|
|
148
153
|
return removed;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
* @returns The method `removeEdge` returns the removed edge (`E`) if it exists, or `null` if the edge does not exist.
|
|
155
|
-
*/
|
|
156
|
-
removeEdge(edge) {
|
|
157
|
-
let removed = null;
|
|
158
|
-
const src = this._getVertex(edge.src);
|
|
159
|
-
const dest = this._getVertex(edge.dest);
|
|
154
|
+
};
|
|
155
|
+
DirectedGraph.prototype.removeEdge = function (edge) {
|
|
156
|
+
var removed = null;
|
|
157
|
+
var src = this._getVertex(edge.src);
|
|
158
|
+
var dest = this._getVertex(edge.dest);
|
|
160
159
|
if (src && dest) {
|
|
161
|
-
|
|
160
|
+
var srcOutEdges = this._outEdgeMap.get(src);
|
|
162
161
|
if (srcOutEdges && srcOutEdges.length > 0) {
|
|
163
|
-
(0, utils_1.arrayRemove)(srcOutEdges, (edge)
|
|
162
|
+
(0, utils_1.arrayRemove)(srcOutEdges, function (edge) { return edge.src === src.id; });
|
|
164
163
|
}
|
|
165
|
-
|
|
164
|
+
var destInEdges = this._inEdgeMap.get(dest);
|
|
166
165
|
if (destInEdges && destInEdges.length > 0) {
|
|
167
|
-
removed = (0, utils_1.arrayRemove)(destInEdges, (edge)
|
|
166
|
+
removed = (0, utils_1.arrayRemove)(destInEdges, function (edge) { return edge.dest === dest.id; })[0];
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
return removed;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
* @param {VertexId | V} v1 - The parameter `v1` can be either a `VertexId` or a `V`. A `VertexId` represents the
|
|
175
|
-
* unique identifier of a vertex in a graph, while `V` represents the actual vertex object.
|
|
176
|
-
* @param {VertexId | V} v2 - The parameter `v2` represents either a `VertexId` or a `V` object. It is used to specify
|
|
177
|
-
* the second vertex in the edge that needs to be removed.
|
|
178
|
-
* @returns an array of removed edges (E[]).
|
|
179
|
-
*/
|
|
180
|
-
removeEdgesBetween(v1, v2) {
|
|
181
|
-
const removed = [];
|
|
170
|
+
};
|
|
171
|
+
DirectedGraph.prototype.removeEdgesBetween = function (v1, v2) {
|
|
172
|
+
var removed = [];
|
|
182
173
|
if (v1 && v2) {
|
|
183
|
-
|
|
184
|
-
|
|
174
|
+
var v1ToV2 = this.removeEdgeSrcToDest(v1, v2);
|
|
175
|
+
var v2ToV1 = this.removeEdgeSrcToDest(v2, v1);
|
|
185
176
|
v1ToV2 && removed.push(v1ToV2);
|
|
186
177
|
v2ToV1 && removed.push(v2ToV1);
|
|
187
178
|
}
|
|
188
179
|
return removed;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can be either a vertex object (`V`) or a vertex ID
|
|
193
|
-
* (`VertexId`).
|
|
194
|
-
* @returns The method `incomingEdgesOf` returns an array of edges (`E[]`).
|
|
195
|
-
*/
|
|
196
|
-
incomingEdgesOf(vertexOrId) {
|
|
197
|
-
const target = this._getVertex(vertexOrId);
|
|
180
|
+
};
|
|
181
|
+
DirectedGraph.prototype.incomingEdgesOf = function (vertexOrId) {
|
|
182
|
+
var target = this._getVertex(vertexOrId);
|
|
198
183
|
if (target) {
|
|
199
184
|
return this.inEdgeMap.get(target) || [];
|
|
200
185
|
}
|
|
201
186
|
return [];
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* @param {V | VertexId} vertexOrId - The parameter `vertexOrId` can accept either a vertex object (`V`) or a vertex ID
|
|
206
|
-
* (`VertexId`).
|
|
207
|
-
* @returns The method `outgoingEdgesOf` returns an array of edges (`E[]`).
|
|
208
|
-
*/
|
|
209
|
-
outgoingEdgesOf(vertexOrId) {
|
|
210
|
-
const target = this._getVertex(vertexOrId);
|
|
187
|
+
};
|
|
188
|
+
DirectedGraph.prototype.outgoingEdgesOf = function (vertexOrId) {
|
|
189
|
+
var target = this._getVertex(vertexOrId);
|
|
211
190
|
if (target) {
|
|
212
191
|
return this._outEdgeMap.get(target) || [];
|
|
213
192
|
}
|
|
214
193
|
return [];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
* The function "degreeOf" returns the total degree of a vertex, which is the sum of its out-degree and in-degree.
|
|
218
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a `V`.
|
|
219
|
-
* @returns The sum of the out-degree and in-degree of the specified vertex or vertex ID.
|
|
220
|
-
*/
|
|
221
|
-
degreeOf(vertexOrId) {
|
|
194
|
+
};
|
|
195
|
+
DirectedGraph.prototype.degreeOf = function (vertexOrId) {
|
|
222
196
|
return this.outDegreeOf(vertexOrId) + this.inDegreeOf(vertexOrId);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
* The function "inDegreeOf" returns the number of incoming edges for a given vertex.
|
|
226
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a `V`.
|
|
227
|
-
* @returns The number of incoming edges of the specified vertex or vertex ID.
|
|
228
|
-
*/
|
|
229
|
-
inDegreeOf(vertexOrId) {
|
|
197
|
+
};
|
|
198
|
+
DirectedGraph.prototype.inDegreeOf = function (vertexOrId) {
|
|
230
199
|
return this.incomingEdgesOf(vertexOrId).length;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
* The function `outDegreeOf` returns the number of outgoing edges from a given vertex.
|
|
234
|
-
* @param {VertexId | V} vertexOrId - The parameter `vertexOrId` can be either a `VertexId` or a `V`.
|
|
235
|
-
* @returns The number of outgoing edges from the specified vertex or vertex ID.
|
|
236
|
-
*/
|
|
237
|
-
outDegreeOf(vertexOrId) {
|
|
200
|
+
};
|
|
201
|
+
DirectedGraph.prototype.outDegreeOf = function (vertexOrId) {
|
|
238
202
|
return this.outgoingEdgesOf(vertexOrId).length;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
*/
|
|
245
|
-
edgesOf(vertexOrId) {
|
|
246
|
-
return [...this.outgoingEdgesOf(vertexOrId), ...this.incomingEdgesOf(vertexOrId)];
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* The function "getEdgeSrc" returns the source vertex of an edge, or null if the edge does not exist.
|
|
250
|
-
* @param {E} e - The parameter "e" is of type E, which represents an edge in a graph.
|
|
251
|
-
* @returns either a vertex object (V) or null.
|
|
252
|
-
*/
|
|
253
|
-
getEdgeSrc(e) {
|
|
203
|
+
};
|
|
204
|
+
DirectedGraph.prototype.edgesOf = function (vertexOrId) {
|
|
205
|
+
return __spreadArray(__spreadArray([], __read(this.outgoingEdgesOf(vertexOrId)), false), __read(this.incomingEdgesOf(vertexOrId)), false);
|
|
206
|
+
};
|
|
207
|
+
DirectedGraph.prototype.getEdgeSrc = function (e) {
|
|
254
208
|
return this._getVertex(e.src);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
* The function "getEdgeDest" returns the destination vertex of an edge.
|
|
258
|
-
* @param {E} e - The parameter "e" is of type "E", which represents an edge in a graph.
|
|
259
|
-
* @returns either a vertex object of type V or null.
|
|
260
|
-
*/
|
|
261
|
-
getEdgeDest(e) {
|
|
209
|
+
};
|
|
210
|
+
DirectedGraph.prototype.getEdgeDest = function (e) {
|
|
262
211
|
return this._getVertex(e.dest);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
* @param {V | VertexId | null} vertex - The `vertex` parameter represents the starting vertex from which we want to
|
|
267
|
-
* find the destinations. It can be either a `V` object, a `VertexId` value, or `null`.
|
|
268
|
-
* @returns an array of vertices (V[]).
|
|
269
|
-
*/
|
|
270
|
-
getDestinations(vertex) {
|
|
212
|
+
};
|
|
213
|
+
DirectedGraph.prototype.getDestinations = function (vertex) {
|
|
214
|
+
var e_1, _a;
|
|
271
215
|
if (vertex === null) {
|
|
272
216
|
return [];
|
|
273
217
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
218
|
+
var destinations = [];
|
|
219
|
+
var outgoingEdges = this.outgoingEdgesOf(vertex);
|
|
220
|
+
try {
|
|
221
|
+
for (var outgoingEdges_1 = __values(outgoingEdges), outgoingEdges_1_1 = outgoingEdges_1.next(); !outgoingEdges_1_1.done; outgoingEdges_1_1 = outgoingEdges_1.next()) {
|
|
222
|
+
var outEdge = outgoingEdges_1_1.value;
|
|
223
|
+
var child = this.getEdgeDest(outEdge);
|
|
224
|
+
if (child) {
|
|
225
|
+
destinations.push(child);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
230
|
+
finally {
|
|
231
|
+
try {
|
|
232
|
+
if (outgoingEdges_1_1 && !outgoingEdges_1_1.done && (_a = outgoingEdges_1.return)) _a.call(outgoingEdges_1);
|
|
280
233
|
}
|
|
234
|
+
finally { if (e_1) throw e_1.error; }
|
|
281
235
|
}
|
|
282
236
|
return destinations;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
* @param {'vertex' | 'id'} [propertyName] - The `propertyName` parameter is an optional parameter that specifies the
|
|
288
|
-
* property to use for sorting the vertices. It can have two possible values: 'vertex' or 'id'. If 'vertex' is
|
|
289
|
-
* specified, the vertices themselves will be used for sorting. If 'id' is specified, the ids of
|
|
290
|
-
* @returns an array of vertices or vertex IDs in topological order. If there is a cycle in the graph, it returns null.
|
|
291
|
-
*/
|
|
292
|
-
topologicalSort(propertyName) {
|
|
237
|
+
};
|
|
238
|
+
DirectedGraph.prototype.topologicalSort = function (propertyName) {
|
|
239
|
+
var e_2, _a, e_3, _b;
|
|
240
|
+
var _this = this;
|
|
293
241
|
propertyName = propertyName !== null && propertyName !== void 0 ? propertyName : 'id';
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
242
|
+
var statusMap = new Map();
|
|
243
|
+
try {
|
|
244
|
+
for (var _c = __values(this.vertices), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
245
|
+
var entry = _d.value;
|
|
246
|
+
statusMap.set(entry[1], 0);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
250
|
+
finally {
|
|
251
|
+
try {
|
|
252
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
253
|
+
}
|
|
254
|
+
finally { if (e_2) throw e_2.error; }
|
|
299
255
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
256
|
+
var sorted = [];
|
|
257
|
+
var hasCycle = false;
|
|
258
|
+
var dfs = function (cur) {
|
|
259
|
+
var e_4, _a;
|
|
303
260
|
statusMap.set(cur, 1);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
261
|
+
var children = _this.getDestinations(cur);
|
|
262
|
+
try {
|
|
263
|
+
for (var children_1 = __values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
|
|
264
|
+
var child = children_1_1.value;
|
|
265
|
+
var childStatus = statusMap.get(child);
|
|
266
|
+
if (childStatus === 0) {
|
|
267
|
+
dfs(child);
|
|
268
|
+
}
|
|
269
|
+
else if (childStatus === 1) {
|
|
270
|
+
hasCycle = true;
|
|
271
|
+
}
|
|
309
272
|
}
|
|
310
|
-
|
|
311
|
-
|
|
273
|
+
}
|
|
274
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
275
|
+
finally {
|
|
276
|
+
try {
|
|
277
|
+
if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1);
|
|
312
278
|
}
|
|
279
|
+
finally { if (e_4) throw e_4.error; }
|
|
313
280
|
}
|
|
314
281
|
statusMap.set(cur, 2);
|
|
315
282
|
sorted.push(cur);
|
|
316
283
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
284
|
+
try {
|
|
285
|
+
for (var _e = __values(this.vertices), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
286
|
+
var entry = _f.value;
|
|
287
|
+
if (statusMap.get(entry[1]) === 0) {
|
|
288
|
+
dfs(entry[1]);
|
|
289
|
+
}
|
|
320
290
|
}
|
|
321
291
|
}
|
|
292
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
293
|
+
finally {
|
|
294
|
+
try {
|
|
295
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
296
|
+
}
|
|
297
|
+
finally { if (e_3) throw e_3.error; }
|
|
298
|
+
}
|
|
322
299
|
if (hasCycle)
|
|
323
300
|
return null;
|
|
324
301
|
if (propertyName === 'id')
|
|
325
|
-
sorted = sorted.map(vertex
|
|
302
|
+
sorted = sorted.map(function (vertex) { return (vertex instanceof DirectedVertex ? vertex.id : vertex); });
|
|
326
303
|
return sorted.reverse();
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
edgeSet() {
|
|
333
|
-
let edges = [];
|
|
334
|
-
this._outEdgeMap.forEach(outEdges => {
|
|
335
|
-
edges = [...edges, ...outEdges];
|
|
304
|
+
};
|
|
305
|
+
DirectedGraph.prototype.edgeSet = function () {
|
|
306
|
+
var edges = [];
|
|
307
|
+
this._outEdgeMap.forEach(function (outEdges) {
|
|
308
|
+
edges = __spreadArray(__spreadArray([], __read(edges), false), __read(outEdges), false);
|
|
336
309
|
});
|
|
337
310
|
return edges;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
* @returns an array of vertices (V[]).
|
|
344
|
-
*/
|
|
345
|
-
getNeighbors(vertexOrId) {
|
|
346
|
-
const neighbors = [];
|
|
347
|
-
const vertex = this._getVertex(vertexOrId);
|
|
311
|
+
};
|
|
312
|
+
DirectedGraph.prototype.getNeighbors = function (vertexOrId) {
|
|
313
|
+
var e_5, _a;
|
|
314
|
+
var neighbors = [];
|
|
315
|
+
var vertex = this._getVertex(vertexOrId);
|
|
348
316
|
if (vertex) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
317
|
+
var outEdges = this.outgoingEdgesOf(vertex);
|
|
318
|
+
try {
|
|
319
|
+
for (var outEdges_1 = __values(outEdges), outEdges_1_1 = outEdges_1.next(); !outEdges_1_1.done; outEdges_1_1 = outEdges_1.next()) {
|
|
320
|
+
var outEdge = outEdges_1_1.value;
|
|
321
|
+
var neighbor = this._getVertex(outEdge.dest);
|
|
322
|
+
if (neighbor) {
|
|
323
|
+
neighbors.push(neighbor);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
328
|
+
finally {
|
|
329
|
+
try {
|
|
330
|
+
if (outEdges_1_1 && !outEdges_1_1.done && (_a = outEdges_1.return)) _a.call(outEdges_1);
|
|
355
331
|
}
|
|
332
|
+
finally { if (e_5) throw e_5.error; }
|
|
356
333
|
}
|
|
357
334
|
}
|
|
358
335
|
return neighbors;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
* The function "getEndsOfEdge" returns the source and destination vertices of an edge if it exists in the graph,
|
|
362
|
-
* otherwise it returns null.
|
|
363
|
-
* @param {E} edge - The parameter `edge` is of type `E`, which represents an edge in a graph.
|
|
364
|
-
* @returns The function `getEndsOfEdge` returns an array containing two vertices `[V, V]` if the edge exists in the
|
|
365
|
-
* graph. If the edge does not exist, it returns `null`.
|
|
366
|
-
*/
|
|
367
|
-
getEndsOfEdge(edge) {
|
|
336
|
+
};
|
|
337
|
+
DirectedGraph.prototype.getEndsOfEdge = function (edge) {
|
|
368
338
|
if (!this.hasEdge(edge.src, edge.dest)) {
|
|
369
339
|
return null;
|
|
370
340
|
}
|
|
371
|
-
|
|
372
|
-
|
|
341
|
+
var v1 = this._getVertex(edge.src);
|
|
342
|
+
var v2 = this._getVertex(edge.dest);
|
|
373
343
|
if (v1 && v2) {
|
|
374
344
|
return [v1, v2];
|
|
375
345
|
}
|
|
376
346
|
else {
|
|
377
347
|
return null;
|
|
378
348
|
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
* The function `_addEdgeOnly` adds an edge to a graph if the source and destination vertices exist.
|
|
382
|
-
* @param {E} edge - The parameter `edge` is of type `E`, which represents an edge in a graph. It is the edge that
|
|
383
|
-
* needs to be added to the graph.
|
|
384
|
-
* @returns a boolean value. It returns true if the edge was successfully added to the graph, and false if either the
|
|
385
|
-
* source or destination vertex does not exist in the graph.
|
|
386
|
-
*/
|
|
387
|
-
_addEdgeOnly(edge) {
|
|
349
|
+
};
|
|
350
|
+
DirectedGraph.prototype._addEdgeOnly = function (edge) {
|
|
388
351
|
if (!(this.hasVertex(edge.src) && this.hasVertex(edge.dest))) {
|
|
389
352
|
return false;
|
|
390
353
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
// TODO after no-non-null-assertion not ensure the logic
|
|
354
|
+
var srcVertex = this._getVertex(edge.src);
|
|
355
|
+
var destVertex = this._getVertex(edge.dest);
|
|
394
356
|
if (srcVertex && destVertex) {
|
|
395
|
-
|
|
357
|
+
var srcOutEdges = this._outEdgeMap.get(srcVertex);
|
|
396
358
|
if (srcOutEdges) {
|
|
397
359
|
srcOutEdges.push(edge);
|
|
398
360
|
}
|
|
399
361
|
else {
|
|
400
362
|
this._outEdgeMap.set(srcVertex, [edge]);
|
|
401
363
|
}
|
|
402
|
-
|
|
364
|
+
var destInEdges = this._inEdgeMap.get(destVertex);
|
|
403
365
|
if (destInEdges) {
|
|
404
366
|
destInEdges.push(edge);
|
|
405
367
|
}
|
|
@@ -411,12 +373,14 @@ class DirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
411
373
|
else {
|
|
412
374
|
return false;
|
|
413
375
|
}
|
|
414
|
-
}
|
|
415
|
-
_setOutEdgeMap(value) {
|
|
376
|
+
};
|
|
377
|
+
DirectedGraph.prototype._setOutEdgeMap = function (value) {
|
|
416
378
|
this._outEdgeMap = value;
|
|
417
|
-
}
|
|
418
|
-
_setInEdgeMap(value) {
|
|
379
|
+
};
|
|
380
|
+
DirectedGraph.prototype._setInEdgeMap = function (value) {
|
|
419
381
|
this._inEdgeMap = value;
|
|
420
|
-
}
|
|
421
|
-
|
|
382
|
+
};
|
|
383
|
+
return DirectedGraph;
|
|
384
|
+
}(abstract_graph_1.AbstractGraph));
|
|
422
385
|
exports.DirectedGraph = DirectedGraph;
|
|
386
|
+
//# sourceMappingURL=directed-graph.js.map
|