@thi.ng/adjacency 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/api.d.ts +9 -9
- package/bfs.d.ts +4 -4
- package/bfs.js +4 -4
- package/dfs.d.ts +3 -3
- package/dfs.js +3 -3
- package/disjoint-set.d.ts +1 -1
- package/disjoint-set.js +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/api.d.ts
CHANGED
|
@@ -18,24 +18,24 @@ export interface IGraph<T = number> {
|
|
|
18
18
|
* is undirected, a symmetric edge might be created automatically. Returns
|
|
19
19
|
* true, if the edge was created.
|
|
20
20
|
*
|
|
21
|
-
* @param from
|
|
22
|
-
* @param to
|
|
21
|
+
* @param from -
|
|
22
|
+
* @param to -
|
|
23
23
|
*/
|
|
24
24
|
addEdge(from: T, to: T): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Attempts to remove an edge for given vertex pair. Returns true, if
|
|
27
27
|
* successful.
|
|
28
28
|
*
|
|
29
|
-
* @param from
|
|
30
|
-
* @param to
|
|
29
|
+
* @param from -
|
|
30
|
+
* @param to -
|
|
31
31
|
*/
|
|
32
32
|
removeEdge(from: T, to: T): boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Returns true if an edge exists for the given vertex pair. For undirected
|
|
35
35
|
* graphs, the vertex order is irrelevant.
|
|
36
36
|
*
|
|
37
|
-
* @param from
|
|
38
|
-
* @param to
|
|
37
|
+
* @param from -
|
|
38
|
+
* @param to -
|
|
39
39
|
*/
|
|
40
40
|
hasEdge(from: T, to: T): boolean;
|
|
41
41
|
/**
|
|
@@ -44,8 +44,8 @@ export interface IGraph<T = number> {
|
|
|
44
44
|
* undirected graphs the `type` has no relevance and essentially is always
|
|
45
45
|
* `"inout"`.
|
|
46
46
|
*
|
|
47
|
-
* @param id
|
|
48
|
-
* @param type
|
|
47
|
+
* @param id -
|
|
48
|
+
* @param type -
|
|
49
49
|
*/
|
|
50
50
|
degree(id: T, type?: DegreeType): number;
|
|
51
51
|
/**
|
|
@@ -53,7 +53,7 @@ export interface IGraph<T = number> {
|
|
|
53
53
|
* edges starting *from* given vertex (or, in undirected graphs, the other
|
|
54
54
|
* vertices of edges which the given vertex is part of).
|
|
55
55
|
*
|
|
56
|
-
* @param id
|
|
56
|
+
* @param id -
|
|
57
57
|
*/
|
|
58
58
|
neighbors(id: T): Iterable<number>;
|
|
59
59
|
/**
|
package/bfs.d.ts
CHANGED
|
@@ -27,10 +27,10 @@ export declare class BFS {
|
|
|
27
27
|
* - https://en.wikipedia.org/wiki/Breadth-first_search
|
|
28
28
|
* - https://algs4.cs.princeton.edu/40graphs/
|
|
29
29
|
*
|
|
30
|
-
* @param graph
|
|
31
|
-
* @param src
|
|
32
|
-
* @param dest
|
|
33
|
-
* @param cost
|
|
30
|
+
* @param graph -
|
|
31
|
+
* @param src -
|
|
32
|
+
* @param dest -
|
|
33
|
+
* @param cost -
|
|
34
34
|
*/
|
|
35
35
|
export declare const bfs: (graph: IGraph, src: number, dest: number, cost?: CostFn<number> | undefined) => Iterable<number> | undefined;
|
|
36
36
|
//# sourceMappingURL=bfs.d.ts.map
|
package/bfs.js
CHANGED
|
@@ -60,9 +60,9 @@ export class BFS {
|
|
|
60
60
|
* - https://en.wikipedia.org/wiki/Breadth-first_search
|
|
61
61
|
* - https://algs4.cs.princeton.edu/40graphs/
|
|
62
62
|
*
|
|
63
|
-
* @param graph
|
|
64
|
-
* @param src
|
|
65
|
-
* @param dest
|
|
66
|
-
* @param cost
|
|
63
|
+
* @param graph -
|
|
64
|
+
* @param src -
|
|
65
|
+
* @param dest -
|
|
66
|
+
* @param cost -
|
|
67
67
|
*/
|
|
68
68
|
export const bfs = (graph, src, dest, cost) => new BFS(graph, src, cost).pathTo(dest);
|
package/dfs.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ export declare class DFS {
|
|
|
15
15
|
* If successful, returns path as iterable or undefined if no path connects the
|
|
16
16
|
* given vertices.
|
|
17
17
|
*
|
|
18
|
-
* @param graph
|
|
19
|
-
* @param src
|
|
20
|
-
* @param dest
|
|
18
|
+
* @param graph -
|
|
19
|
+
* @param src -
|
|
20
|
+
* @param dest -
|
|
21
21
|
*/
|
|
22
22
|
export declare const dfs: (graph: IGraph, src: number, dest: number) => Iterable<number> | undefined;
|
|
23
23
|
//# sourceMappingURL=dfs.d.ts.map
|
package/dfs.js
CHANGED
|
@@ -39,8 +39,8 @@ export class DFS {
|
|
|
39
39
|
* If successful, returns path as iterable or undefined if no path connects the
|
|
40
40
|
* given vertices.
|
|
41
41
|
*
|
|
42
|
-
* @param graph
|
|
43
|
-
* @param src
|
|
44
|
-
* @param dest
|
|
42
|
+
* @param graph -
|
|
43
|
+
* @param src -
|
|
44
|
+
* @param dest -
|
|
45
45
|
*/
|
|
46
46
|
export const dfs = (graph, src, dest) => new DFS(graph, src).pathTo(dest);
|
package/disjoint-set.d.ts
CHANGED
package/disjoint-set.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/adjacency",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Sparse & bitwise adjacency matrices and related functions for directed & undirected graphs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/arrays": "^2.
|
|
39
|
-
"@thi.ng/bitfield": "^2.1.
|
|
40
|
-
"@thi.ng/dcons": "^3.
|
|
41
|
-
"@thi.ng/errors": "^2.1.
|
|
42
|
-
"@thi.ng/sparse": "^0.3.
|
|
37
|
+
"@thi.ng/api": "^8.3.4",
|
|
38
|
+
"@thi.ng/arrays": "^2.2.0",
|
|
39
|
+
"@thi.ng/bitfield": "^2.1.5",
|
|
40
|
+
"@thi.ng/dcons": "^3.2.0",
|
|
41
|
+
"@thi.ng/errors": "^2.1.4",
|
|
42
|
+
"@thi.ng/sparse": "^0.3.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.19.
|
|
46
|
-
"@thi.ng/testament": "^0.2.
|
|
47
|
-
"@thi.ng/vectors": "^7.
|
|
45
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
46
|
+
"@thi.ng/testament": "^0.2.4",
|
|
47
|
+
"@thi.ng/vectors": "^7.5.0",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"tools": "^0.0.1",
|
|
50
|
-
"typedoc": "^0.22.
|
|
51
|
-
"typescript": "^4.
|
|
50
|
+
"typedoc": "^0.22.13",
|
|
51
|
+
"typescript": "^4.6.2"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"adjacency",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
],
|
|
120
120
|
"year": 2018
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
|
|
123
123
|
}
|