data-structure-typed 1.42.0 → 1.42.2

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.
@@ -3,27 +3,27 @@
3
3
  "benchmarks": [
4
4
  {
5
5
  "test name": "10,000 add randomly",
6
- "time taken (ms)": "34.10",
7
- "executions per sec": "29.32",
8
- "sample deviation": "0.00"
6
+ "time taken (ms)": "31.93",
7
+ "executions per sec": "31.32",
8
+ "sample deviation": "2.30e-4"
9
9
  },
10
10
  {
11
11
  "test name": "10,000 add & delete randomly",
12
- "time taken (ms)": "74.44",
13
- "executions per sec": "13.43",
12
+ "time taken (ms)": "69.12",
13
+ "executions per sec": "14.47",
14
14
  "sample deviation": "0.00"
15
15
  },
16
16
  {
17
17
  "test name": "10,000 addMany",
18
- "time taken (ms)": "44.65",
19
- "executions per sec": "22.39",
20
- "sample deviation": "0.00"
18
+ "time taken (ms)": "41.14",
19
+ "executions per sec": "24.31",
20
+ "sample deviation": "1.60e-4"
21
21
  },
22
22
  {
23
23
  "test name": "10,000 get",
24
- "time taken (ms)": "30.76",
25
- "executions per sec": "32.51",
26
- "sample deviation": "0.00"
24
+ "time taken (ms)": "28.68",
25
+ "executions per sec": "34.86",
26
+ "sample deviation": "7.65e-4"
27
27
  }
28
28
  ],
29
29
  "testName": "avl-tree"
@@ -32,45 +32,45 @@
32
32
  "benchmarks": [
33
33
  {
34
34
  "test name": "1,000 add randomly",
35
- "time taken (ms)": "13.23",
36
- "executions per sec": "75.58",
37
- "sample deviation": "2.94e-4"
35
+ "time taken (ms)": "13.12",
36
+ "executions per sec": "76.21",
37
+ "sample deviation": "3.40e-4"
38
38
  },
39
39
  {
40
40
  "test name": "1,000 add & delete randomly",
41
- "time taken (ms)": "16.29",
42
- "executions per sec": "61.38",
43
- "sample deviation": "7.50e-4"
41
+ "time taken (ms)": "16.33",
42
+ "executions per sec": "61.22",
43
+ "sample deviation": "4.17e-4"
44
44
  },
45
45
  {
46
46
  "test name": "1,000 addMany",
47
- "time taken (ms)": "10.58",
48
- "executions per sec": "94.51",
49
- "sample deviation": "1.17e-4"
47
+ "time taken (ms)": "10.96",
48
+ "executions per sec": "91.22",
49
+ "sample deviation": "3.99e-4"
50
50
  },
51
51
  {
52
52
  "test name": "1,000 get",
53
- "time taken (ms)": "18.09",
54
- "executions per sec": "55.28",
55
- "sample deviation": "3.74e-4"
53
+ "time taken (ms)": "18.65",
54
+ "executions per sec": "53.63",
55
+ "sample deviation": "4.20e-4"
56
56
  },
57
57
  {
58
58
  "test name": "1,000 dfs",
59
- "time taken (ms)": "71.97",
60
- "executions per sec": "13.89",
59
+ "time taken (ms)": "71.82",
60
+ "executions per sec": "13.92",
61
61
  "sample deviation": "0.00"
62
62
  },
63
63
  {
64
64
  "test name": "1,000 bfs",
65
- "time taken (ms)": "57.49",
66
- "executions per sec": "17.39",
67
- "sample deviation": "5.01e-4"
65
+ "time taken (ms)": "58.95",
66
+ "executions per sec": "16.96",
67
+ "sample deviation": "0.00"
68
68
  },
69
69
  {
70
70
  "test name": "1,000 morris",
71
- "time taken (ms)": "37.35",
72
- "executions per sec": "26.78",
73
- "sample deviation": "2.94e-4"
71
+ "time taken (ms)": "37.46",
72
+ "executions per sec": "26.70",
73
+ "sample deviation": "4.60e-4"
74
74
  }
75
75
  ],
76
76
  "testName": "binary-tree"
@@ -79,27 +79,27 @@
79
79
  "benchmarks": [
80
80
  {
81
81
  "test name": "10,000 add randomly",
82
- "time taken (ms)": "33.54",
83
- "executions per sec": "29.81",
84
- "sample deviation": "3.61e-4"
82
+ "time taken (ms)": "32.98",
83
+ "executions per sec": "30.32",
84
+ "sample deviation": "0.00"
85
85
  },
86
86
  {
87
87
  "test name": "10,000 add & delete randomly",
88
- "time taken (ms)": "75.05",
89
- "executions per sec": "13.33",
88
+ "time taken (ms)": "74.47",
89
+ "executions per sec": "13.43",
90
90
  "sample deviation": "0.00"
91
91
  },
92
92
  {
93
93
  "test name": "10,000 addMany",
94
- "time taken (ms)": "31.50",
95
- "executions per sec": "31.74",
96
- "sample deviation": "4.90e-4"
94
+ "time taken (ms)": "29.93",
95
+ "executions per sec": "33.41",
96
+ "sample deviation": "6.02e-4"
97
97
  },
98
98
  {
99
99
  "test name": "10,000 get",
100
- "time taken (ms)": "34.92",
101
- "executions per sec": "28.64",
102
- "sample deviation": "0.01"
100
+ "time taken (ms)": "29.92",
101
+ "executions per sec": "33.42",
102
+ "sample deviation": "8.61e-4"
103
103
  }
104
104
  ],
105
105
  "testName": "bst"
@@ -108,21 +108,21 @@
108
108
  "benchmarks": [
109
109
  {
110
110
  "test name": "100,000 add randomly",
111
- "time taken (ms)": "80.61",
112
- "executions per sec": "12.41",
111
+ "time taken (ms)": "80.49",
112
+ "executions per sec": "12.42",
113
113
  "sample deviation": "0.01"
114
114
  },
115
115
  {
116
116
  "test name": "100,000 add & 1000 delete randomly",
117
- "time taken (ms)": "86.72",
118
- "executions per sec": "11.53",
117
+ "time taken (ms)": "89.97",
118
+ "executions per sec": "11.11",
119
119
  "sample deviation": "0.01"
120
120
  },
121
121
  {
122
122
  "test name": "100,000 getNode",
123
- "time taken (ms)": "75.09",
124
- "executions per sec": "13.32",
125
- "sample deviation": "0.03"
123
+ "time taken (ms)": "68.63",
124
+ "executions per sec": "14.57",
125
+ "sample deviation": "0.01"
126
126
  }
127
127
  ],
128
128
  "testName": "rb-tree"
@@ -131,45 +131,45 @@
131
131
  "benchmarks": [
132
132
  {
133
133
  "test name": "1,000 addVertex",
134
- "time taken (ms)": "0.12",
135
- "executions per sec": "8506.54",
136
- "sample deviation": "3.38e-5"
134
+ "time taken (ms)": "0.10",
135
+ "executions per sec": "9878.72",
136
+ "sample deviation": "1.87e-6"
137
137
  },
138
138
  {
139
139
  "test name": "1,000 addEdge",
140
- "time taken (ms)": "6.96",
141
- "executions per sec": "143.61",
142
- "sample deviation": "0.00"
140
+ "time taken (ms)": "6.34",
141
+ "executions per sec": "157.78",
142
+ "sample deviation": "2.53e-4"
143
143
  },
144
144
  {
145
145
  "test name": "1,000 getVertex",
146
146
  "time taken (ms)": "0.05",
147
- "executions per sec": "1.85e+4",
148
- "sample deviation": "2.60e-5"
147
+ "executions per sec": "2.12e+4",
148
+ "sample deviation": "1.05e-6"
149
149
  },
150
150
  {
151
151
  "test name": "1,000 getEdge",
152
- "time taken (ms)": "23.99",
153
- "executions per sec": "41.69",
154
- "sample deviation": "0.01"
152
+ "time taken (ms)": "23.08",
153
+ "executions per sec": "43.33",
154
+ "sample deviation": "0.00"
155
155
  },
156
156
  {
157
157
  "test name": "tarjan",
158
- "time taken (ms)": "205.07",
159
- "executions per sec": "4.88",
160
- "sample deviation": "0.04"
158
+ "time taken (ms)": "217.75",
159
+ "executions per sec": "4.59",
160
+ "sample deviation": "0.01"
161
161
  },
162
162
  {
163
163
  "test name": "tarjan all",
164
- "time taken (ms)": "211.45",
165
- "executions per sec": "4.73",
166
- "sample deviation": "0.04"
164
+ "time taken (ms)": "219.23",
165
+ "executions per sec": "4.56",
166
+ "sample deviation": "0.01"
167
167
  },
168
168
  {
169
169
  "test name": "topologicalSort",
170
- "time taken (ms)": "186.95",
171
- "executions per sec": "5.35",
172
- "sample deviation": "0.06"
170
+ "time taken (ms)": "175.73",
171
+ "executions per sec": "5.69",
172
+ "sample deviation": "0.02"
173
173
  }
174
174
  ],
175
175
  "testName": "directed-graph"
@@ -178,15 +178,15 @@
178
178
  "benchmarks": [
179
179
  {
180
180
  "test name": "10,000 add & pop",
181
- "time taken (ms)": "5.03",
182
- "executions per sec": "198.77",
183
- "sample deviation": "0.00"
181
+ "time taken (ms)": "4.64",
182
+ "executions per sec": "215.44",
183
+ "sample deviation": "6.89e-5"
184
184
  },
185
185
  {
186
186
  "test name": "10,000 fib add & pop",
187
- "time taken (ms)": "373.81",
188
- "executions per sec": "2.68",
189
- "sample deviation": "0.03"
187
+ "time taken (ms)": "357.37",
188
+ "executions per sec": "2.80",
189
+ "sample deviation": "0.01"
190
190
  }
191
191
  ],
192
192
  "testName": "heap"
@@ -195,21 +195,21 @@
195
195
  "benchmarks": [
196
196
  {
197
197
  "test name": "1,000,000 unshift",
198
- "time taken (ms)": "231.55",
199
- "executions per sec": "4.32",
200
- "sample deviation": "0.03"
198
+ "time taken (ms)": "239.34",
199
+ "executions per sec": "4.18",
200
+ "sample deviation": "0.04"
201
201
  },
202
202
  {
203
203
  "test name": "1,000,000 unshift & shift",
204
- "time taken (ms)": "163.44",
205
- "executions per sec": "6.12",
206
- "sample deviation": "0.01"
204
+ "time taken (ms)": "168.74",
205
+ "executions per sec": "5.93",
206
+ "sample deviation": "0.04"
207
207
  },
208
208
  {
209
209
  "test name": "1,000,000 insertBefore",
210
- "time taken (ms)": "301.21",
211
- "executions per sec": "3.32",
212
- "sample deviation": "0.03"
210
+ "time taken (ms)": "324.74",
211
+ "executions per sec": "3.08",
212
+ "sample deviation": "0.06"
213
213
  }
214
214
  ],
215
215
  "testName": "doubly-linked-list"
@@ -218,15 +218,15 @@
218
218
  "benchmarks": [
219
219
  {
220
220
  "test name": "10,000 push & pop",
221
- "time taken (ms)": "216.27",
222
- "executions per sec": "4.62",
221
+ "time taken (ms)": "213.86",
222
+ "executions per sec": "4.68",
223
223
  "sample deviation": "0.01"
224
224
  },
225
225
  {
226
226
  "test name": "10,000 insertBefore",
227
- "time taken (ms)": "252.18",
228
- "executions per sec": "3.97",
229
- "sample deviation": "0.01"
227
+ "time taken (ms)": "254.02",
228
+ "executions per sec": "3.94",
229
+ "sample deviation": "0.02"
230
230
  }
231
231
  ],
232
232
  "testName": "singly-linked-list"
@@ -235,9 +235,9 @@
235
235
  "benchmarks": [
236
236
  {
237
237
  "test name": "10,000 refill & poll",
238
- "time taken (ms)": "11.56",
239
- "executions per sec": "86.52",
240
- "sample deviation": "2.35e-4"
238
+ "time taken (ms)": "11.39",
239
+ "executions per sec": "87.76",
240
+ "sample deviation": "2.14e-4"
241
241
  }
242
242
  ],
243
243
  "testName": "max-priority-queue"
@@ -246,14 +246,14 @@
246
246
  "benchmarks": [
247
247
  {
248
248
  "test name": "1,000,000 push",
249
- "time taken (ms)": "222.98",
250
- "executions per sec": "4.48",
249
+ "time taken (ms)": "233.91",
250
+ "executions per sec": "4.28",
251
251
  "sample deviation": "0.05"
252
252
  },
253
253
  {
254
254
  "test name": "1,000,000 shift",
255
- "time taken (ms)": "26.01",
256
- "executions per sec": "38.44",
255
+ "time taken (ms)": "25.61",
256
+ "executions per sec": "39.05",
257
257
  "sample deviation": "0.00"
258
258
  }
259
259
  ],
@@ -263,14 +263,14 @@
263
263
  "benchmarks": [
264
264
  {
265
265
  "test name": "1,000,000 push",
266
- "time taken (ms)": "44.93",
267
- "executions per sec": "22.26",
266
+ "time taken (ms)": "43.88",
267
+ "executions per sec": "22.79",
268
268
  "sample deviation": "0.01"
269
269
  },
270
270
  {
271
271
  "test name": "1,000,000 push & shift",
272
- "time taken (ms)": "80.87",
273
- "executions per sec": "12.37",
272
+ "time taken (ms)": "81.71",
273
+ "executions per sec": "12.24",
274
274
  "sample deviation": "0.00"
275
275
  }
276
276
  ],
@@ -280,14 +280,14 @@
280
280
  "benchmarks": [
281
281
  {
282
282
  "test name": "100,000 push",
283
- "time taken (ms)": "57.22",
284
- "executions per sec": "17.48",
283
+ "time taken (ms)": "59.93",
284
+ "executions per sec": "16.69",
285
285
  "sample deviation": "0.01"
286
286
  },
287
287
  {
288
288
  "test name": "100,000 getWords",
289
- "time taken (ms)": "99.32",
290
- "executions per sec": "10.07",
289
+ "time taken (ms)": "93.10",
290
+ "executions per sec": "10.74",
291
291
  "sample deviation": "0.01"
292
292
  }
293
293
  ],
@@ -252,10 +252,6 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
252
252
  * Floyd algorithm time: O(VO^3) space: O(VO^2), not support graph with negative weight cycle
253
253
  * all pairs
254
254
  * The Floyd-Warshall algorithm is used to find the shortest paths between all pairs of nodes in a graph. It employs dynamic programming to compute the shortest paths from any node to any other node. The Floyd-Warshall algorithm's advantage lies in its ability to handle graphs with negative-weight edges, and it can simultaneously compute shortest paths between any two nodes.
255
- */
256
- /**
257
- * Floyd algorithm time: O(VO^3) space: O(VO^2), not support graph with negative weight cycle
258
- * all pairs
259
255
  * /
260
256
 
261
257
  /**
@@ -264,12 +260,12 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
264
260
  * The Floyd-Warshall algorithm is used to find the shortest paths between all pairs of nodes in a graph. It employs dynamic programming to compute the shortest paths from any node to any other node. The Floyd-Warshall algorithm's advantage lies in its ability to handle graphs with negative-weight edges, and it can simultaneously compute shortest paths between any two nodes.
265
261
  * The function implements the Floyd-Warshall algorithm to find the shortest path between all pairs of vertices in a
266
262
  * graph.
267
- * @returns The function `floyd()` returns an object with two properties: `costs` and `predecessor`. The `costs`
263
+ * @returns The function `floydWarshall()` returns an object with two properties: `costs` and `predecessor`. The `costs`
268
264
  * property is a 2D array of numbers representing the shortest path costs between vertices in a graph. The
269
265
  * `predecessor` property is a 2D array of vertices (or `null`) representing the predecessor vertices in the shortest
270
266
  * path between vertices in the
271
267
  */
272
- floyd(): {
268
+ floydWarshall(): {
273
269
  costs: number[][];
274
270
  predecessor: (VO | null)[][];
275
271
  };
@@ -289,7 +285,7 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
289
285
  * Tarjan can find the SSC(strongly connected components), articulation points, and bridges of directed graphs.
290
286
  * The `tarjan` function is used to perform various graph analysis tasks such as finding articulation points, bridges,
291
287
  * strongly connected components (SCCs), and cycles in a graph.
292
- * @param {boolean} [needArticulationPoints] - A boolean value indicating whether or not to calculate and return the
288
+ * @param {boolean} [needCutVertexes] - A boolean value indicating whether or not to calculate and return the
293
289
  * articulation points in the graph. Articulation points are the vertices in a graph whose removal would increase the
294
290
  * number of connected components in the graph.
295
291
  * @param {boolean} [needBridges] - A boolean flag indicating whether the algorithm should find and return the bridges
@@ -302,14 +298,48 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
302
298
  * are arrays of vertices that form cycles within the SCCs.
303
299
  * @returns The function `tarjan` returns an object with the following properties:
304
300
  */
305
- tarjan(needArticulationPoints?: boolean, needBridges?: boolean, needSCCs?: boolean, needCycles?: boolean): {
301
+ tarjan(needCutVertexes?: boolean, needBridges?: boolean, needSCCs?: boolean, needCycles?: boolean): {
306
302
  dfnMap: Map<VO, number>;
307
303
  lowMap: Map<VO, number>;
308
304
  bridges: EO[];
309
- articulationPoints: VO[];
305
+ cutVertexes: VO[];
310
306
  SCCs: Map<number, VO[]>;
311
307
  cycles: Map<number, VO[]>;
312
308
  };
309
+ /**
310
+ * The function returns a map that associates each vertex object with its corresponding depth-first
311
+ * number.
312
+ * @returns A Map object with keys of type VO and values of type number.
313
+ */
314
+ getDFNMap(): Map<VO, number>;
315
+ /**
316
+ * The function returns a Map object that contains the low values of each vertex in a Tarjan
317
+ * algorithm.
318
+ * @returns The method `getLowMap()` is returning a `Map` object with keys of type `VO` and values of
319
+ * type `number`.
320
+ */
321
+ getLowMap(): Map<VO, number>;
322
+ /**
323
+ * The function `getCycles` returns a map of cycles found using the Tarjan algorithm.
324
+ * @returns The function `getCycles()` is returning a `Map<number, VO[]>`.
325
+ */
326
+ getCycles(): Map<number, VO[]>;
327
+ /**
328
+ * The function "getCutVertexes" returns an array of cut vertexes using the Tarjan algorithm.
329
+ * @returns an array of VO objects, specifically the cut vertexes.
330
+ */
331
+ getCutVertexes(): VO[];
332
+ /**
333
+ * The function "getSCCs" returns a map of strongly connected components (SCCs) using the Tarjan
334
+ * algorithm.
335
+ * @returns a map where the keys are numbers and the values are arrays of VO objects.
336
+ */
337
+ getSCCs(): Map<number, VO[]>;
338
+ /**
339
+ * The function "getBridges" returns an array of bridges using the Tarjan algorithm.
340
+ * @returns the bridges found using the Tarjan algorithm.
341
+ */
342
+ getBridges(): EO[];
313
343
  protected abstract _addEdgeOnly(edge: EO): boolean;
314
344
  protected _addVertexOnly(newVertex: VO): boolean;
315
345
  protected _getVertex(vertexOrKey: VertexKey | VO): VO | null;
@@ -704,10 +704,6 @@ class AbstractGraph {
704
704
  * Floyd algorithm time: O(VO^3) space: O(VO^2), not support graph with negative weight cycle
705
705
  * all pairs
706
706
  * The Floyd-Warshall algorithm is used to find the shortest paths between all pairs of nodes in a graph. It employs dynamic programming to compute the shortest paths from any node to any other node. The Floyd-Warshall algorithm's advantage lies in its ability to handle graphs with negative-weight edges, and it can simultaneously compute shortest paths between any two nodes.
707
- */
708
- /**
709
- * Floyd algorithm time: O(VO^3) space: O(VO^2), not support graph with negative weight cycle
710
- * all pairs
711
707
  * /
712
708
 
713
709
  /**
@@ -716,12 +712,12 @@ class AbstractGraph {
716
712
  * The Floyd-Warshall algorithm is used to find the shortest paths between all pairs of nodes in a graph. It employs dynamic programming to compute the shortest paths from any node to any other node. The Floyd-Warshall algorithm's advantage lies in its ability to handle graphs with negative-weight edges, and it can simultaneously compute shortest paths between any two nodes.
717
713
  * The function implements the Floyd-Warshall algorithm to find the shortest path between all pairs of vertices in a
718
714
  * graph.
719
- * @returns The function `floyd()` returns an object with two properties: `costs` and `predecessor`. The `costs`
715
+ * @returns The function `floydWarshall()` returns an object with two properties: `costs` and `predecessor`. The `costs`
720
716
  * property is a 2D array of numbers representing the shortest path costs between vertices in a graph. The
721
717
  * `predecessor` property is a 2D array of vertices (or `null`) representing the predecessor vertices in the shortest
722
718
  * path between vertices in the
723
719
  */
724
- floyd() {
720
+ floydWarshall() {
725
721
  var _a;
726
722
  const idAndVertices = [...this._vertices];
727
723
  const n = idAndVertices.length;
@@ -768,7 +764,7 @@ class AbstractGraph {
768
764
  * Tarjan can find the SSC(strongly connected components), articulation points, and bridges of directed graphs.
769
765
  * The `tarjan` function is used to perform various graph analysis tasks such as finding articulation points, bridges,
770
766
  * strongly connected components (SCCs), and cycles in a graph.
771
- * @param {boolean} [needArticulationPoints] - A boolean value indicating whether or not to calculate and return the
767
+ * @param {boolean} [needCutVertexes] - A boolean value indicating whether or not to calculate and return the
772
768
  * articulation points in the graph. Articulation points are the vertices in a graph whose removal would increase the
773
769
  * number of connected components in the graph.
774
770
  * @param {boolean} [needBridges] - A boolean flag indicating whether the algorithm should find and return the bridges
@@ -781,13 +777,13 @@ class AbstractGraph {
781
777
  * are arrays of vertices that form cycles within the SCCs.
782
778
  * @returns The function `tarjan` returns an object with the following properties:
783
779
  */
784
- tarjan(needArticulationPoints, needBridges, needSCCs, needCycles) {
780
+ tarjan(needCutVertexes = false, needBridges = false, needSCCs = true, needCycles = false) {
785
781
  // !! in undirected graph we will not let child visit parent when dfs
786
782
  // !! articulation point(in dfs search tree not in graph): (cur !== root && cur.has(child)) && (low(child) >= dfn(cur)) || (cur === root && cur.children() >= 2)
787
783
  // !! bridge: low(child) > dfn(cur)
788
784
  const defaultConfig = false;
789
- if (needArticulationPoints === undefined)
790
- needArticulationPoints = defaultConfig;
785
+ if (needCutVertexes === undefined)
786
+ needCutVertexes = defaultConfig;
791
787
  if (needBridges === undefined)
792
788
  needBridges = defaultConfig;
793
789
  if (needSCCs === undefined)
@@ -802,7 +798,7 @@ class AbstractGraph {
802
798
  lowMap.set(v, Infinity);
803
799
  });
804
800
  const [root] = vertices.values();
805
- const articulationPoints = [];
801
+ const cutVertexes = [];
806
802
  const bridges = [];
807
803
  let dfn = 0;
808
804
  const dfs = (cur, parent) => {
@@ -825,10 +821,10 @@ class AbstractGraph {
825
821
  }
826
822
  const curFromMap = dfnMap.get(cur);
827
823
  if (childLow !== undefined && curFromMap !== undefined) {
828
- if (needArticulationPoints) {
824
+ if (needCutVertexes) {
829
825
  if ((cur === root && childCount >= 2) || (cur !== root && childLow >= curFromMap)) {
830
826
  // todo not ensure the logic if (cur === root && childCount >= 2 || ((cur !== root) && (childLow >= curFromMap))) {
831
- articulationPoints.push(cur);
827
+ cutVertexes.push(cur);
832
828
  }
833
829
  }
834
830
  if (needBridges) {
@@ -873,7 +869,53 @@ class AbstractGraph {
873
869
  }
874
870
  });
875
871
  }
876
- return { dfnMap, lowMap, bridges, articulationPoints, SCCs, cycles };
872
+ return { dfnMap, lowMap, bridges, cutVertexes, SCCs, cycles };
873
+ }
874
+ /**
875
+ * The function returns a map that associates each vertex object with its corresponding depth-first
876
+ * number.
877
+ * @returns A Map object with keys of type VO and values of type number.
878
+ */
879
+ getDFNMap() {
880
+ return this.tarjan(false, false, false, false).dfnMap;
881
+ }
882
+ /**
883
+ * The function returns a Map object that contains the low values of each vertex in a Tarjan
884
+ * algorithm.
885
+ * @returns The method `getLowMap()` is returning a `Map` object with keys of type `VO` and values of
886
+ * type `number`.
887
+ */
888
+ getLowMap() {
889
+ return this.tarjan(false, false, false, false).lowMap;
890
+ }
891
+ /**
892
+ * The function `getCycles` returns a map of cycles found using the Tarjan algorithm.
893
+ * @returns The function `getCycles()` is returning a `Map<number, VO[]>`.
894
+ */
895
+ getCycles() {
896
+ return this.tarjan(false, false, false, true).cycles;
897
+ }
898
+ /**
899
+ * The function "getCutVertexes" returns an array of cut vertexes using the Tarjan algorithm.
900
+ * @returns an array of VO objects, specifically the cut vertexes.
901
+ */
902
+ getCutVertexes() {
903
+ return this.tarjan(true, false, false, false).cutVertexes;
904
+ }
905
+ /**
906
+ * The function "getSCCs" returns a map of strongly connected components (SCCs) using the Tarjan
907
+ * algorithm.
908
+ * @returns a map where the keys are numbers and the values are arrays of VO objects.
909
+ */
910
+ getSCCs() {
911
+ return this.tarjan(false, false, true, false).SCCs;
912
+ }
913
+ /**
914
+ * The function "getBridges" returns an array of bridges using the Tarjan algorithm.
915
+ * @returns the bridges found using the Tarjan algorithm.
916
+ */
917
+ getBridges() {
918
+ return this.tarjan(false, true, false, false).bridges;
877
919
  }
878
920
  _addVertexOnly(newVertex) {
879
921
  if (this.hasVertex(newVertex)) {