typescript-ds-lib 0.4.0 → 0.4.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.
Files changed (45) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +9 -7
  3. package/dist/algorithms/binary-search.d.ts +14 -0
  4. package/dist/algorithms/binary-search.js +36 -0
  5. package/dist/algorithms/binary-search.js.map +1 -0
  6. package/dist/algorithms/shuffle.d.ts +1 -0
  7. package/dist/algorithms/shuffle.js +20 -0
  8. package/dist/algorithms/shuffle.js.map +1 -0
  9. package/dist/index.d.ts +4 -0
  10. package/dist/index.js +9 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/lib/binary-search-tree.js +2 -2
  13. package/dist/lib/binary-search-tree.js.map +1 -1
  14. package/dist/lib/deque.js.map +1 -1
  15. package/dist/lib/graph/base.d.ts +167 -0
  16. package/dist/lib/graph/base.js +233 -0
  17. package/dist/lib/graph/base.js.map +1 -0
  18. package/dist/lib/graph/linked-list-graph.d.ts +18 -0
  19. package/dist/lib/graph/linked-list-graph.js +71 -0
  20. package/dist/lib/graph/linked-list-graph.js.map +1 -0
  21. package/dist/lib/graph/matrix-graph.d.ts +18 -0
  22. package/dist/lib/graph/matrix-graph.js +102 -0
  23. package/dist/lib/graph/matrix-graph.js.map +1 -0
  24. package/dist/lib/hash-table.js.map +1 -1
  25. package/dist/lib/hash-utils.js +3 -2
  26. package/dist/lib/hash-utils.js.map +1 -1
  27. package/dist/lib/heap.js +2 -4
  28. package/dist/lib/heap.js.map +1 -1
  29. package/dist/lib/linked-list.js.map +1 -1
  30. package/dist/lib/map.js.map +1 -1
  31. package/dist/lib/matrix.js +14 -6
  32. package/dist/lib/matrix.js.map +1 -1
  33. package/dist/lib/priority-queue.js.map +1 -1
  34. package/dist/lib/queue.js.map +1 -1
  35. package/dist/lib/red-black-tree.js +1 -2
  36. package/dist/lib/red-black-tree.js.map +1 -1
  37. package/dist/lib/set.js.map +1 -1
  38. package/dist/lib/stack.d.ts +1 -1
  39. package/dist/lib/stack.js.map +1 -1
  40. package/dist/lib/utils.js +13 -17
  41. package/dist/lib/utils.js.map +1 -1
  42. package/package.json +10 -6
  43. package/dist/lib/graph.d.ts +0 -14
  44. package/dist/lib/graph.js +0 -3
  45. package/dist/lib/graph.js.map +0 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Artiom Baloian
3
+ Copyright (c) 2026 Artiom Baloian
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # TypeScript Data Structure Library
2
2
  [![NPM](https://img.shields.io/npm/v/typescript-ds-lib?label=npm%20package&color=limegreen)](https://www.npmjs.com/package/typescript-ds-lib)
3
3
 
4
- TypeScript data structure implementations without external dependencies. Why to use this library?
4
+ TypeScript data structure and algorithm implementations without external dependencies.
5
5
 
6
+ **Why to use this library?**
6
7
  - Fully Tested
7
8
  - Fast
8
9
  - 0 Dependencies
9
10
  - Lightweight
10
11
  - Comes with Comparator (for custom types)
11
- - `equals()` method supported for all data structures
12
+ - `equals()` method provided for all data structures
12
13
  - Well documented
13
14
 
14
15
 
@@ -36,12 +37,13 @@ console.log(stack.size()); // 2
36
37
 
37
38
 
38
39
  ## Documentation and Examples
39
- See the [documentation](https://github.com/baloian/typescript-ds-lib/blob/master/doc/DOCUMENTATION.md) for more details and examples.
40
+ See the [documentation](https://github.com/baloian/typescript-ds-lib/blob/master/doc/README.md) for more details and examples.
40
41
 
41
42
 
42
43
  ## Data Structures
43
44
  - Binary Search Tree
44
45
  - Deque
46
+ - Graph (beta version and partially tested)
45
47
  - Hash Table (unordered map)
46
48
  - Heap
47
49
  - Linked List
@@ -52,8 +54,10 @@ See the [documentation](https://github.com/baloian/typescript-ds-lib/blob/master
52
54
  - Red-Black Tree
53
55
  - Set
54
56
  - Stack
55
- - Graph (coming soon)
56
57
 
58
+ ## Algorithms
59
+ - Binary Search (with custom comparator)
60
+ - Shuffle (shuffles the array in-place)
57
61
 
58
62
  ## `Map-Set` vs Native JavaScript `Map-Set`
59
63
  The library's `Map` and `Set` data structures are implemented as Red-Black Tree and Binary Search Tree respectively.
@@ -69,9 +73,7 @@ You can consider the library's `Map` and `Set` as ordered map and set, and nativ
69
73
 
70
74
  ## Contributions
71
75
  Contributions are welcome and can be made by submitting GitHub pull requests
72
- to this repository. In general, the source code follows
73
- [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) and the
74
- rules specified in `.eslintrc.json` file.
76
+ to this repository.
75
77
 
76
78
 
77
79
  ## License
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Performs a binary search on a sorted array to locate a target element.
3
+ *
4
+ * This function assumes that the input array is sorted in ascending order with respect to the comparison logic.
5
+ * It accepts an optional comparison function for custom sorting logic; if not provided,
6
+ * native < and > operators are used.
7
+ *
8
+ * @param arr - A sorted array of elements of type T.
9
+ * @param target - The element to search for within the array.
10
+ * @param compare - (Optional) A comparison function that returns a negative value if the first argument is less
11
+ * than the second, a positive value if the first is greater, and zero if they are considered equal.
12
+ * @returns The index of the target element if it is found in the array; otherwise, returns -1.
13
+ */
14
+ export declare function binarySearch<T>(arr: T[], target: T, compare?: (a: T, b: T) => number): number;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.binarySearch = binarySearch;
4
+ /**
5
+ * Performs a binary search on a sorted array to locate a target element.
6
+ *
7
+ * This function assumes that the input array is sorted in ascending order with respect to the comparison logic.
8
+ * It accepts an optional comparison function for custom sorting logic; if not provided,
9
+ * native < and > operators are used.
10
+ *
11
+ * @param arr - A sorted array of elements of type T.
12
+ * @param target - The element to search for within the array.
13
+ * @param compare - (Optional) A comparison function that returns a negative value if the first argument is less
14
+ * than the second, a positive value if the first is greater, and zero if they are considered equal.
15
+ * @returns The index of the target element if it is found in the array; otherwise, returns -1.
16
+ */
17
+ function binarySearch(arr, target, compare) {
18
+ let left = 0;
19
+ let right = arr.length - 1;
20
+ const cmp = compare ? compare : (a, b) => (a < b ? -1 : a > b ? 1 : 0);
21
+ while (left <= right) {
22
+ const mid = left + Math.floor((right - left) / 2);
23
+ const comparison = cmp(arr[mid], target);
24
+ if (comparison === 0) {
25
+ return mid;
26
+ }
27
+ if (comparison < 0) {
28
+ left = mid + 1;
29
+ }
30
+ else {
31
+ right = mid - 1;
32
+ }
33
+ }
34
+ return -1;
35
+ }
36
+ //# sourceMappingURL=binary-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-search.js","sourceRoot":"","sources":["../../algorithms/binary-search.ts"],"names":[],"mappings":";;AAaA,oCAiBC;AA9BD;;;;;;;;;;;;GAYG;AACH,SAAgB,YAAY,CAAI,GAAQ,EAAE,MAAS,EAAE,OAAgC;IACnF,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAI,EAAE,CAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,IAAI,IAAI,KAAK,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function shuffle<T>(array: T[]): void;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.shuffle = shuffle;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ /*
9
+ * Fisher-Yates shuffle algorithm, Durstenfeld's variant as described in
10
+ * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
11
+ *
12
+ * This function shuffles the given array in-place.
13
+ */
14
+ function shuffle(array) {
15
+ for (let i = array.length - 1; i > 0; i--) {
16
+ const j = crypto_1.default.randomInt(0, i + 1);
17
+ [array[i], array[j]] = [array[j], array[i]];
18
+ }
19
+ }
20
+ //# sourceMappingURL=shuffle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shuffle.js","sourceRoot":"","sources":["../../algorithms/shuffle.ts"],"names":[],"mappings":";;;;;AAQA,0BAKC;AAbD,oDAAgC;AAEhC;;;;;EAKE;AACF,SAAgB,OAAO,CAAI,KAAU;IACnC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,gBAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './types';
2
2
  export { BinarySearchTree } from './lib/binary-search-tree';
3
3
  export { Deque } from './lib/deque';
4
+ export { MatrixGraph } from './lib/graph/matrix-graph';
5
+ export { LinkedListGraph } from './lib/graph/linked-list-graph';
4
6
  export { HashTable } from './lib/hash-table';
5
7
  export { Heap } from './lib/heap';
6
8
  export { LinkedList } from './lib/linked-list';
@@ -11,3 +13,5 @@ export { Queue } from './lib/queue';
11
13
  export { RedBlackTree } from './lib/red-black-tree';
12
14
  export { Set } from './lib/set';
13
15
  export { Stack } from './lib/stack';
16
+ export { binarySearch } from './algorithms/binary-search';
17
+ export { shuffle } from './algorithms/shuffle';
package/dist/index.js CHANGED
@@ -14,12 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Stack = exports.Set = exports.RedBlackTree = exports.Queue = exports.PriorityQueue = exports.Matrix = exports.Map = exports.LinkedList = exports.Heap = exports.HashTable = exports.Deque = exports.BinarySearchTree = void 0;
17
+ exports.shuffle = exports.binarySearch = exports.Stack = exports.Set = exports.RedBlackTree = exports.Queue = exports.PriorityQueue = exports.Matrix = exports.Map = exports.LinkedList = exports.Heap = exports.HashTable = exports.LinkedListGraph = exports.MatrixGraph = exports.Deque = exports.BinarySearchTree = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  var binary_search_tree_1 = require("./lib/binary-search-tree");
20
20
  Object.defineProperty(exports, "BinarySearchTree", { enumerable: true, get: function () { return binary_search_tree_1.BinarySearchTree; } });
21
21
  var deque_1 = require("./lib/deque");
22
22
  Object.defineProperty(exports, "Deque", { enumerable: true, get: function () { return deque_1.Deque; } });
23
+ var matrix_graph_1 = require("./lib/graph/matrix-graph");
24
+ Object.defineProperty(exports, "MatrixGraph", { enumerable: true, get: function () { return matrix_graph_1.MatrixGraph; } });
25
+ var linked_list_graph_1 = require("./lib/graph/linked-list-graph");
26
+ Object.defineProperty(exports, "LinkedListGraph", { enumerable: true, get: function () { return linked_list_graph_1.LinkedListGraph; } });
23
27
  var hash_table_1 = require("./lib/hash-table");
24
28
  Object.defineProperty(exports, "HashTable", { enumerable: true, get: function () { return hash_table_1.HashTable; } });
25
29
  var heap_1 = require("./lib/heap");
@@ -40,4 +44,8 @@ var set_1 = require("./lib/set");
40
44
  Object.defineProperty(exports, "Set", { enumerable: true, get: function () { return set_1.Set; } });
41
45
  var stack_1 = require("./lib/stack");
42
46
  Object.defineProperty(exports, "Stack", { enumerable: true, get: function () { return stack_1.Stack; } });
47
+ var binary_search_1 = require("./algorithms/binary-search");
48
+ Object.defineProperty(exports, "binarySearch", { enumerable: true, get: function () { return binary_search_1.binarySearch; } });
49
+ var shuffle_1 = require("./algorithms/shuffle");
50
+ Object.defineProperty(exports, "shuffle", { enumerable: true, get: function () { return shuffle_1.shuffle; } });
43
51
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+DAA4D;AAAnD,sHAAA,gBAAgB,OAAA;AACzB,qCAAoC;AAA3B,8FAAA,KAAK,OAAA;AACd,+CAA6C;AAApC,uGAAA,SAAS,OAAA;AAClB,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,iDAA+C;AAAtC,yGAAA,UAAU,OAAA;AACnB,iCAAgC;AAAvB,0FAAA,GAAG,OAAA;AACZ,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,uDAAqD;AAA5C,+GAAA,aAAa,OAAA;AACtB,qCAAoC;AAA3B,8FAAA,KAAK,OAAA;AACd,uDAAoD;AAA3C,8GAAA,YAAY,OAAA;AACrB,iCAAgC;AAAvB,0FAAA,GAAG,OAAA;AACZ,qCAAoC;AAA3B,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+DAA4D;AAAnD,sHAAA,gBAAgB,OAAA;AACzB,qCAAoC;AAA3B,8FAAA,KAAK,OAAA;AACd,yDAAuD;AAA9C,2GAAA,WAAW,OAAA;AACpB,mEAAgE;AAAvD,oHAAA,eAAe,OAAA;AACxB,+CAA6C;AAApC,uGAAA,SAAS,OAAA;AAClB,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,iDAA+C;AAAtC,yGAAA,UAAU,OAAA;AACnB,iCAAgC;AAAvB,0FAAA,GAAG,OAAA;AACZ,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,uDAAqD;AAA5C,+GAAA,aAAa,OAAA;AACtB,qCAAoC;AAA3B,8FAAA,KAAK,OAAA;AACd,uDAAoD;AAA3C,8GAAA,YAAY,OAAA;AACrB,iCAAgC;AAAvB,0FAAA,GAAG,OAAA;AACZ,qCAAoC;AAA3B,8FAAA,KAAK,OAAA;AACd,4DAA0D;AAAjD,6GAAA,YAAY,OAAA;AACrB,gDAA+C;AAAtC,kGAAA,OAAO,OAAA"}
@@ -218,9 +218,9 @@ class BinarySearchTree extends base_collection_1.BaseCollection {
218
218
  return true;
219
219
  if (node1 === null || node2 === null)
220
220
  return false;
221
- return this.isEqual(node1.value, node2.value) &&
221
+ return (this.isEqual(node1.value, node2.value) &&
222
222
  this.areTreesEqual(node1.left, node2.left) &&
223
- this.areTreesEqual(node1.right, node2.right);
223
+ this.areTreesEqual(node1.right, node2.right));
224
224
  }
225
225
  }
226
226
  exports.BinarySearchTree = BinarySearchTree;
@@ -1 +1 @@
1
- {"version":3,"file":"binary-search-tree.js","sourceRoot":"","sources":["../../lib/binary-search-tree.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E,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAe;QACpB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF;AA9ED,sBA8EC"}
@@ -0,0 +1,167 @@
1
+ import { BaseCollection } from '../base-collection';
2
+ /**
3
+ * Base class for Graph data structure implementations.
4
+ * Provides common functionality that can be extended by specific implementations
5
+ * like LinkedList-based or Matrix-based graphs.
6
+ */
7
+ export declare abstract class BaseGraph<V, W = number> extends BaseCollection<V> {
8
+ protected vertices: Set<V>;
9
+ protected vertexToIndex: Map<V, number>;
10
+ protected indexToVertex: Map<number, V>;
11
+ protected nextVertexIndex: number;
12
+ constructor();
13
+ /**
14
+ * Adds a vertex to the graph.
15
+ * @param vertex - The vertex to add
16
+ */
17
+ addVertex(vertex: V): void;
18
+ /**
19
+ * Removes a vertex from the graph and all its associated edges.
20
+ * @param vertex - The vertex to remove
21
+ */
22
+ removeVertex(vertex: V): void;
23
+ /**
24
+ * Adds an edge between two vertices with an optional weight.
25
+ * @param from - The source vertex
26
+ * @param to - The destination vertex
27
+ * @param weight - The weight of the edge (default: 1)
28
+ */
29
+ addEdge(from: V, to: V, weight?: W): void;
30
+ /**
31
+ * Removes an edge between two vertices.
32
+ * @param from - The source vertex
33
+ * @param to - The destination vertex
34
+ */
35
+ removeEdge(from: V, to: V): void;
36
+ /**
37
+ * Gets all neighbors of a vertex.
38
+ * @param vertex - The vertex to get neighbors for
39
+ * @returns Array of neighboring vertices
40
+ */
41
+ getNeighbors(vertex: V): V[];
42
+ /**
43
+ * Gets the weight of an edge between two vertices.
44
+ * @param from - The source vertex
45
+ * @param to - The destination vertex
46
+ * @returns The weight of the edge, or undefined if no edge exists
47
+ */
48
+ getEdgeWeight(from: V, to: V): W | undefined;
49
+ /**
50
+ * Gets all vertices in the graph.
51
+ * @returns Array of all vertices
52
+ */
53
+ getVertices(): V[];
54
+ /**
55
+ * Checks if a vertex exists in the graph.
56
+ * @param vertex - The vertex to check
57
+ * @returns True if the vertex exists, false otherwise
58
+ */
59
+ hasVertex(vertex: V): boolean;
60
+ /**
61
+ * Checks if an edge exists between two vertices.
62
+ * @param from - The source vertex
63
+ * @param to - The destination vertex
64
+ * @returns True if the edge exists, false otherwise
65
+ */
66
+ hasEdge(from: V, to: V): boolean;
67
+ /**
68
+ * Returns the number of vertices in the graph.
69
+ * @returns The number of vertices
70
+ */
71
+ vertexCount(): number;
72
+ /**
73
+ * Returns the number of edges in the graph.
74
+ * @returns The number of edges
75
+ */
76
+ edgeCount(): number;
77
+ /**
78
+ * Clears all vertices and edges from the graph.
79
+ */
80
+ clear(): void;
81
+ /**
82
+ * Returns the number of elements (vertices) in the graph.
83
+ * @returns The number of vertices
84
+ */
85
+ size(): number;
86
+ /**
87
+ * Checks if the graph is empty.
88
+ * @returns True if the graph has no vertices, false otherwise
89
+ */
90
+ isEmpty(): boolean;
91
+ /**
92
+ * Checks if this graph equals another graph.
93
+ * @param other - The other graph to compare with
94
+ * @returns True if the graphs are equal, false otherwise
95
+ */
96
+ equals(other: BaseGraph<V, W>): boolean;
97
+ /**
98
+ * Gets the index of a vertex.
99
+ * @param vertex - The vertex to get the index for
100
+ * @returns The index of the vertex, or -1 if not found
101
+ */
102
+ protected getVertexIndex(vertex: V): number;
103
+ /**
104
+ * Gets the vertex at a given index.
105
+ * @param index - The index to get the vertex for
106
+ * @returns The vertex at the index, or undefined if not found
107
+ */
108
+ protected getVertexAt(index: number): V | undefined;
109
+ /**
110
+ * Gets all vertex indices.
111
+ * @returns Array of vertex indices
112
+ */
113
+ protected getAllVertexIndices(): number[];
114
+ /**
115
+ * Called when a vertex is added to the graph.
116
+ * @param vertex - The vertex that was added
117
+ */
118
+ protected abstract onVertexAdded(vertex: V): void;
119
+ /**
120
+ * Called when a vertex is removed from the graph.
121
+ * @param vertex - The vertex that was removed
122
+ * @param vertexIndex - The index of the removed vertex
123
+ */
124
+ protected abstract onVertexRemoved(vertex: V, vertexIndex: number): void;
125
+ /**
126
+ * Called when an edge is added to the graph.
127
+ * @param from - The source vertex
128
+ * @param to - The destination vertex
129
+ * @param weight - The weight of the edge
130
+ */
131
+ protected abstract onEdgeAdded(from: V, to: V, weight: W): void;
132
+ /**
133
+ * Called when an edge is removed from the graph.
134
+ * @param from - The source vertex
135
+ * @param to - The destination vertex
136
+ */
137
+ protected abstract onEdgeRemoved(from: V, to: V): void;
138
+ /**
139
+ * Gets the neighbors of a vertex.
140
+ * @param vertex - The vertex to get neighbors for
141
+ * @returns Array of neighboring vertices
142
+ */
143
+ protected abstract onGetNeighbors(vertex: V): V[];
144
+ /**
145
+ * Gets the weight of an edge between two vertices.
146
+ * @param from - The source vertex
147
+ * @param to - The destination vertex
148
+ * @returns The weight of the edge, or undefined if no edge exists
149
+ */
150
+ protected abstract onGetEdgeWeight(from: V, to: V): W | undefined;
151
+ /**
152
+ * Checks if an edge exists between two vertices.
153
+ * @param from - The source vertex
154
+ * @param to - The destination vertex
155
+ * @returns True if the edge exists, false otherwise
156
+ */
157
+ protected abstract onHasEdge(from: V, to: V): boolean;
158
+ /**
159
+ * Gets the total number of edges in the graph.
160
+ * @returns The number of edges
161
+ */
162
+ protected abstract onGetEdgeCount(): number;
163
+ /**
164
+ * Called when the graph is cleared.
165
+ */
166
+ protected abstract onClear(): void;
167
+ }
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseGraph = void 0;
4
+ const base_collection_1 = require("../base-collection");
5
+ /**
6
+ * Base class for Graph data structure implementations.
7
+ * Provides common functionality that can be extended by specific implementations
8
+ * like LinkedList-based or Matrix-based graphs.
9
+ */
10
+ class BaseGraph extends base_collection_1.BaseCollection {
11
+ vertices;
12
+ vertexToIndex;
13
+ indexToVertex;
14
+ nextVertexIndex;
15
+ constructor() {
16
+ super();
17
+ this.vertices = new Set();
18
+ this.vertexToIndex = new Map();
19
+ this.indexToVertex = new Map();
20
+ this.nextVertexIndex = 0;
21
+ }
22
+ /**
23
+ * Adds a vertex to the graph.
24
+ * @param vertex - The vertex to add
25
+ */
26
+ addVertex(vertex) {
27
+ if (!this.vertices.has(vertex)) {
28
+ this.vertices.add(vertex);
29
+ this.vertexToIndex.set(vertex, this.nextVertexIndex);
30
+ this.indexToVertex.set(this.nextVertexIndex, vertex);
31
+ this.nextVertexIndex++;
32
+ this.onVertexAdded(vertex);
33
+ }
34
+ }
35
+ /**
36
+ * Removes a vertex from the graph and all its associated edges.
37
+ * @param vertex - The vertex to remove
38
+ */
39
+ removeVertex(vertex) {
40
+ if (this.vertices.has(vertex)) {
41
+ const vertexIndex = this.vertexToIndex.get(vertex);
42
+ // Remove all edges connected to this vertex
43
+ this.getVertices().forEach((otherVertex) => {
44
+ if (otherVertex !== vertex) {
45
+ this.removeEdge(vertex, otherVertex);
46
+ this.removeEdge(otherVertex, vertex);
47
+ }
48
+ });
49
+ // Remove from tracking collections
50
+ this.vertices.delete(vertex);
51
+ this.indexToVertex.delete(vertexIndex);
52
+ this.vertexToIndex.delete(vertex);
53
+ this.onVertexRemoved(vertex, vertexIndex);
54
+ }
55
+ }
56
+ /**
57
+ * Adds an edge between two vertices with an optional weight.
58
+ * @param from - The source vertex
59
+ * @param to - The destination vertex
60
+ * @param weight - The weight of the edge (default: 1)
61
+ */
62
+ addEdge(from, to, weight = 1) {
63
+ if (!this.vertices.has(from)) {
64
+ this.addVertex(from);
65
+ }
66
+ if (!this.vertices.has(to)) {
67
+ this.addVertex(to);
68
+ }
69
+ if (from !== to) {
70
+ this.onEdgeAdded(from, to, weight);
71
+ }
72
+ }
73
+ /**
74
+ * Removes an edge between two vertices.
75
+ * @param from - The source vertex
76
+ * @param to - The destination vertex
77
+ */
78
+ removeEdge(from, to) {
79
+ if (this.vertices.has(from) && this.vertices.has(to)) {
80
+ this.onEdgeRemoved(from, to);
81
+ }
82
+ }
83
+ /**
84
+ * Gets all neighbors of a vertex.
85
+ * @param vertex - The vertex to get neighbors for
86
+ * @returns Array of neighboring vertices
87
+ */
88
+ getNeighbors(vertex) {
89
+ if (!this.vertices.has(vertex)) {
90
+ return [];
91
+ }
92
+ return this.onGetNeighbors(vertex);
93
+ }
94
+ /**
95
+ * Gets the weight of an edge between two vertices.
96
+ * @param from - The source vertex
97
+ * @param to - The destination vertex
98
+ * @returns The weight of the edge, or undefined if no edge exists
99
+ */
100
+ getEdgeWeight(from, to) {
101
+ if (!this.vertices.has(from) || !this.vertices.has(to)) {
102
+ return undefined;
103
+ }
104
+ return this.onGetEdgeWeight(from, to);
105
+ }
106
+ /**
107
+ * Gets all vertices in the graph.
108
+ * @returns Array of all vertices
109
+ */
110
+ getVertices() {
111
+ return Array.from(this.vertices);
112
+ }
113
+ /**
114
+ * Checks if a vertex exists in the graph.
115
+ * @param vertex - The vertex to check
116
+ * @returns True if the vertex exists, false otherwise
117
+ */
118
+ hasVertex(vertex) {
119
+ return this.vertices.has(vertex);
120
+ }
121
+ /**
122
+ * Checks if an edge exists between two vertices.
123
+ * @param from - The source vertex
124
+ * @param to - The destination vertex
125
+ * @returns True if the edge exists, false otherwise
126
+ */
127
+ hasEdge(from, to) {
128
+ if (!this.vertices.has(from) || !this.vertices.has(to)) {
129
+ return false;
130
+ }
131
+ return this.onHasEdge(from, to);
132
+ }
133
+ /**
134
+ * Returns the number of vertices in the graph.
135
+ * @returns The number of vertices
136
+ */
137
+ vertexCount() {
138
+ return this.vertices.size;
139
+ }
140
+ /**
141
+ * Returns the number of edges in the graph.
142
+ * @returns The number of edges
143
+ */
144
+ edgeCount() {
145
+ return this.onGetEdgeCount();
146
+ }
147
+ /**
148
+ * Clears all vertices and edges from the graph.
149
+ */
150
+ clear() {
151
+ this.vertices.clear();
152
+ this.vertexToIndex.clear();
153
+ this.indexToVertex.clear();
154
+ this.nextVertexIndex = 0;
155
+ this.onClear();
156
+ }
157
+ /**
158
+ * Returns the number of elements (vertices) in the graph.
159
+ * @returns The number of vertices
160
+ */
161
+ size() {
162
+ return this.vertexCount();
163
+ }
164
+ /**
165
+ * Checks if the graph is empty.
166
+ * @returns True if the graph has no vertices, false otherwise
167
+ */
168
+ isEmpty() {
169
+ return this.vertices.size === 0;
170
+ }
171
+ /**
172
+ * Checks if this graph equals another graph.
173
+ * @param other - The other graph to compare with
174
+ * @returns True if the graphs are equal, false otherwise
175
+ */
176
+ equals(other) {
177
+ if (!(other instanceof BaseGraph)) {
178
+ return false;
179
+ }
180
+ if (this.vertexCount() !== other.vertexCount()) {
181
+ return false;
182
+ }
183
+ const thisVertices = this.getVertices();
184
+ const otherVertices = other.getVertices();
185
+ // Check if all vertices exist in both graphs
186
+ for (const vertex of thisVertices) {
187
+ if (!other.hasVertex(vertex)) {
188
+ return false;
189
+ }
190
+ }
191
+ // Check if all edges exist in both graphs
192
+ for (const from of thisVertices) {
193
+ for (const to of thisVertices) {
194
+ if (this.hasEdge(from, to) !== other.hasEdge(from, to)) {
195
+ return false;
196
+ }
197
+ if (this.hasEdge(from, to)) {
198
+ const thisWeight = this.getEdgeWeight(from, to);
199
+ const otherWeight = other.getEdgeWeight(from, to);
200
+ if (thisWeight !== otherWeight) {
201
+ return false;
202
+ }
203
+ }
204
+ }
205
+ }
206
+ return true;
207
+ }
208
+ /**
209
+ * Gets the index of a vertex.
210
+ * @param vertex - The vertex to get the index for
211
+ * @returns The index of the vertex, or -1 if not found
212
+ */
213
+ getVertexIndex(vertex) {
214
+ return this.vertexToIndex.get(vertex) ?? -1;
215
+ }
216
+ /**
217
+ * Gets the vertex at a given index.
218
+ * @param index - The index to get the vertex for
219
+ * @returns The vertex at the index, or undefined if not found
220
+ */
221
+ getVertexAt(index) {
222
+ return this.indexToVertex.get(index);
223
+ }
224
+ /**
225
+ * Gets all vertex indices.
226
+ * @returns Array of vertex indices
227
+ */
228
+ getAllVertexIndices() {
229
+ return Array.from(this.vertexToIndex.values());
230
+ }
231
+ }
232
+ exports.BaseGraph = BaseGraph;
233
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../lib/graph/base.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAEpD;;;;GAIG;AACH,MAAsB,SAAyB,SAAQ,gCAAiB;IAC5D,QAAQ,CAAS;IACjB,aAAa,CAAiB;IAC9B,aAAa,CAAiB;IAC9B,eAAe,CAAS;IAElC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAK,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAa,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAa,CAAC;QAC1C,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,MAAS;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,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