@thi.ng/adjacency 3.0.63 → 3.0.64

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 210 standalone projects, maintained as part
10
+ > This is one of 211 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
package/bfs.js CHANGED
@@ -22,7 +22,7 @@ class BFS {
22
22
  marked.setAt(id);
23
23
  while (queue.length) {
24
24
  const v = queue.drop();
25
- for (let n of graph.neighbors(v)) {
25
+ for (const n of graph.neighbors(v)) {
26
26
  const c = dist[v] + cost(v, n);
27
27
  if (c < dist[n] || !marked.at(n)) {
28
28
  edges[n] = v;
package/binary.js CHANGED
@@ -13,7 +13,7 @@ class AdjacencyBitMatrix {
13
13
  *edges() {
14
14
  const directed = !this.undirected;
15
15
  for (let i = this.mat.m; i-- > 0; ) {
16
- for (let n of this.neighbors(i)) {
16
+ for (const n of this.neighbors(i)) {
17
17
  if (directed || n > i) {
18
18
  yield [i, n];
19
19
  }
package/dfs.js CHANGED
@@ -16,7 +16,7 @@ class DFS {
16
16
  search(id) {
17
17
  const { edges, marked } = this;
18
18
  marked.setAt(id);
19
- for (let n of this.graph.neighbors(id)) {
19
+ for (const n of this.graph.neighbors(id)) {
20
20
  if (!marked.at(n)) {
21
21
  edges[n] = id;
22
22
  this.search(n);
package/floyd-warshall.js CHANGED
@@ -14,7 +14,7 @@ class FloydWarshall {
14
14
  const numV = this.numV = graph.numVertices();
15
15
  const dist = this.dist = new Float32Array(numV * numV).fill(Infinity);
16
16
  const next = this.next = new Int32Array(numV * numV).fill(-1);
17
- for (let [u, v] of graph.edges()) {
17
+ for (const [u, v] of graph.edges()) {
18
18
  const idx = u * numV + v;
19
19
  dist[idx] = cost(u, v);
20
20
  next[idx] = v;
package/list.js CHANGED
@@ -24,7 +24,7 @@ class AdjacencyList {
24
24
  for (let i = 0, n = adjacency.length; i < n; i++) {
25
25
  const vertex = adjacency[i];
26
26
  if (!vertex) continue;
27
- for (let j of vertex) yield [i, j];
27
+ for (const j of vertex) yield [i, j];
28
28
  }
29
29
  }
30
30
  addVertex(id) {
@@ -119,7 +119,7 @@ const adjListFromAdjacency = (src) => {
119
119
  for (let i = 0, n = src.length; i < n; i++) {
120
120
  const v = src[i];
121
121
  if (!v) continue;
122
- for (let w of v) res.addEdge(i, w);
122
+ for (const w of v) res.addEdge(i, w);
123
123
  }
124
124
  return res;
125
125
  };
package/mst.js CHANGED
@@ -3,7 +3,7 @@ import { DisjointSet } from "@thi.ng/disjoint-set";
3
3
  const mst = (edges, maxID, cost, verts) => {
4
4
  const graph = new DisjointSet(maxID + 1);
5
5
  const res = [];
6
- for (let e of sortByCachedKey(edges, cost)) {
6
+ for (const e of sortByCachedKey(edges, cost)) {
7
7
  const v = verts(e);
8
8
  if (!graph.unified(v[0], v[1])) {
9
9
  graph.union(v[0], v[1]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/adjacency",
3
- "version": "3.0.63",
3
+ "version": "3.0.64",
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",
@@ -42,16 +42,16 @@
42
42
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
43
43
  },
44
44
  "dependencies": {
45
- "@thi.ng/api": "^8.12.9",
46
- "@thi.ng/arrays": "^2.14.2",
47
- "@thi.ng/bitfield": "^2.4.21",
48
- "@thi.ng/dcons": "^3.2.177",
49
- "@thi.ng/disjoint-set": "^1.1.36",
50
- "@thi.ng/errors": "^2.5.49",
51
- "@thi.ng/sparse": "^1.1.24"
45
+ "@thi.ng/api": "^8.12.10",
46
+ "@thi.ng/arrays": "^2.14.3",
47
+ "@thi.ng/bitfield": "^2.4.22",
48
+ "@thi.ng/dcons": "^3.2.178",
49
+ "@thi.ng/disjoint-set": "^1.1.37",
50
+ "@thi.ng/errors": "^2.5.50",
51
+ "@thi.ng/sparse": "^1.1.25"
52
52
  },
53
53
  "devDependencies": {
54
- "@thi.ng/vectors": "^8.6.14",
54
+ "@thi.ng/vectors": "^8.6.15",
55
55
  "esbuild": "^0.27.0",
56
56
  "typedoc": "^0.28.14",
57
57
  "typescript": "^5.9.3"
@@ -125,5 +125,5 @@
125
125
  ],
126
126
  "year": 2018
127
127
  },
128
- "gitHead": "fdca77cabf47dd23a9ab17a5ca13e3060075c12c\n"
128
+ "gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
129
129
  }
package/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const __toDot = (edges, undirected, ids) => {
2
2
  const [type, sep] = undirected ? ["graph", "--"] : ["digraph", "->"];
3
3
  const res = [`${type} g {`];
4
- for (let e of edges) {
4
+ for (const e of edges) {
5
5
  res.push(
6
6
  ids ? `"${ids[e[0]]}"${sep}"${ids[e[1]]}";` : `"${e[0]}"${sep}"${e[1]}";`
7
7
  );
@@ -10,12 +10,12 @@ const __toDot = (edges, undirected, ids) => {
10
10
  return res.join("\n");
11
11
  };
12
12
  const __into = (graph, edges) => {
13
- for (let e of edges) {
13
+ for (const e of edges) {
14
14
  graph.addEdge(e[0], e[1]);
15
15
  }
16
16
  };
17
17
  const __invert = (graph, edges) => {
18
- for (let e of edges) {
18
+ for (const e of edges) {
19
19
  graph.addEdge(e[1], e[0]);
20
20
  }
21
21
  return graph;