@thi.ng/adjacency 2.5.6 → 2.5.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-10-30T14:31:56Z
3
+ - **Last updated**: 2023-11-09T10:28:18Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -74,7 +74,7 @@ For Node.js REPL:
74
74
  const adjacency = await import("@thi.ng/adjacency");
75
75
  ```
76
76
 
77
- Package sizes (brotli'd, pre-treeshake): ESM: 2.57 KB
77
+ Package sizes (brotli'd, pre-treeshake): ESM: 2.74 KB
78
78
 
79
79
  ## Dependencies
80
80
 
package/bfs.js CHANGED
@@ -13,6 +13,10 @@ import { DCons } from "@thi.ng/dcons/dcons";
13
13
  * - https://algs4.cs.princeton.edu/40graphs/
14
14
  */
15
15
  export class BFS {
16
+ graph;
17
+ marked;
18
+ edges;
19
+ dist;
16
20
  constructor(graph, src, cost = () => 1) {
17
21
  this.graph = graph;
18
22
  const numV = graph.numVertices();
package/binary.js CHANGED
@@ -7,6 +7,9 @@ import { __into, __invert, __toDot } from "./utils.js";
7
7
  * storing 16384 directed edges in just 2KB of memory (128 * 128 / 8 = 2048).
8
8
  */
9
9
  export class AdjacencyBitMatrix {
10
+ mat;
11
+ undirected;
12
+ numE;
10
13
  constructor(n, edges, undirected = false) {
11
14
  this.mat = new BitMatrix(n);
12
15
  this.undirected = undirected;
package/dfs.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { BitField } from "@thi.ng/bitfield/bitfield";
2
2
  import { DCons } from "@thi.ng/dcons/dcons";
3
3
  export class DFS {
4
+ graph;
5
+ marked;
6
+ edges;
7
+ src;
4
8
  constructor(graph, src) {
5
9
  this.graph = graph;
6
10
  this.src = src;
package/disjoint-set.js CHANGED
@@ -8,6 +8,9 @@ import { fillRange } from "@thi.ng/arrays/fill-range";
8
8
  * - https://algs4.cs.princeton.edu/lectures/15UnionFind-2x2.pdf
9
9
  */
10
10
  export class DisjointSet {
11
+ roots;
12
+ ranks;
13
+ count;
11
14
  /**
12
15
  * Creates new instance with `n` initial singular subsets.
13
16
  *
package/floyd-warshall.js CHANGED
@@ -20,6 +20,9 @@ import { outOfBounds } from "@thi.ng/errors/out-of-bounds";
20
20
  * - https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
21
21
  */
22
22
  export class FloydWarshall {
23
+ dist;
24
+ next;
25
+ numV;
23
26
  /**
24
27
  * Instantiates and pre-computes all shortest paths in given `graph`. See
25
28
  * class comments for details.
package/list.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { __into, __invert, __toDot } from "./utils.js";
2
2
  export class AdjacencyList {
3
+ adjacency = [];
4
+ indegree = [];
5
+ numE = 0;
6
+ numV = 0;
3
7
  constructor(edges) {
4
- this.adjacency = [];
5
- this.indegree = [];
6
- this.numE = 0;
7
- this.numV = 0;
8
8
  edges && __into(this, edges);
9
9
  }
10
10
  numEdges() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/adjacency",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "description": "Sparse & bitwise adjacency matrices, lists and selected traversal algorithms for directed & undirected graphs",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -31,26 +31,25 @@
31
31
  "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
32
32
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
33
33
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
34
- "doc:readme": "yarn doc:stats && tools:readme",
35
- "doc:stats": "tools:module-stats",
34
+ "doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
36
35
  "pub": "yarn npm publish --access public",
37
- "test": "testament test"
36
+ "test": "bun test"
38
37
  },
39
38
  "dependencies": {
40
- "@thi.ng/api": "^8.9.6",
41
- "@thi.ng/arrays": "^2.7.2",
42
- "@thi.ng/bitfield": "^2.3.4",
43
- "@thi.ng/dcons": "^3.2.70",
44
- "@thi.ng/errors": "^2.4.0",
45
- "@thi.ng/sparse": "^0.3.75"
39
+ "@thi.ng/api": "^8.9.8",
40
+ "@thi.ng/arrays": "^2.7.4",
41
+ "@thi.ng/bitfield": "^2.3.6",
42
+ "@thi.ng/dcons": "^3.2.72",
43
+ "@thi.ng/errors": "^2.4.2",
44
+ "@thi.ng/sparse": "^0.3.77"
46
45
  },
47
46
  "devDependencies": {
48
- "@microsoft/api-extractor": "^7.38.0",
49
- "@thi.ng/testament": "^0.3.24",
50
- "@thi.ng/vectors": "^7.8.2",
47
+ "@microsoft/api-extractor": "^7.38.2",
48
+ "@thi.ng/testament": "^0.4.1",
49
+ "@thi.ng/vectors": "^7.8.4",
51
50
  "rimraf": "^5.0.5",
52
51
  "tools": "^0.0.1",
53
- "typedoc": "^0.25.2",
52
+ "typedoc": "^0.25.3",
54
53
  "typescript": "^5.2.2"
55
54
  },
56
55
  "keywords": [
@@ -125,5 +124,5 @@
125
124
  ],
126
125
  "year": 2018
127
126
  },
128
- "gitHead": "336bd1bf95825b3c318a3ab49c54451c94aaa883\n"
127
+ "gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
129
128
  }
package/sparse.js CHANGED
@@ -2,6 +2,7 @@ import { ensureIndex2 } from "@thi.ng/errors/out-of-bounds";
2
2
  import { CSR } from "@thi.ng/sparse/csr";
3
3
  import { __into, __invert, __toDot } from "./utils.js";
4
4
  export class AdjacencyMatrix extends CSR {
5
+ undirected;
5
6
  constructor(n, data, rows, cols, undirected = false) {
6
7
  super(n, n, data, rows, cols);
7
8
  this.undirected = undirected;