@graphty/algorithms 1.4.2 → 1.5.0
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 +10 -9
- package/dist/algorithms.js +3 -3
- package/dist/algorithms.js.map +1 -1
- package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.d.ts +1 -1
- package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.d.ts.map +1 -1
- package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.js +1 -1
- package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.js.map +1 -1
- package/dist/src/research/grsbm.js +2 -2
- package/dist/src/research/grsbm.js.map +1 -1
- package/dist/src/research/sync.js +2 -2
- package/dist/src/research/sync.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +9 -22
- package/src/algorithms/shortest-path/bidirectional-dijkstra.ts +1 -1
- package/src/research/grsbm.ts +2 -2
- package/src/research/sync.ts +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @graphty/algorithms
|
|
2
2
|
|
|
3
|
-
[](https://github.com/graphty-org/graphty-monorepo/actions/workflows/ci.yml)
|
|
4
|
+
[](https://coveralls.io/github/graphty-org/graphty-monorepo?branch=master)
|
|
5
5
|
[](https://www.npmjs.com/package/@graphty/algorithms)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
[](https://graphty.app/docs/algorithms/)
|
|
8
|
+
[](https://graphty.app/algorithms/)
|
|
8
9
|
|
|
9
10
|
A comprehensive TypeScript graph algorithms library with 98 algorithms optimized for browser environments and visualization applications.
|
|
10
11
|
|
|
@@ -14,8 +15,8 @@ A comprehensive TypeScript graph algorithms library with 98 algorithms optimized
|
|
|
14
15
|
- **Browser-optimized**: Designed to run efficiently in web browsers
|
|
15
16
|
- **Modular**: Import only the algorithms you need
|
|
16
17
|
- **Comprehensive**: 98 graph algorithms including traversal, shortest paths, centrality, clustering, flow, matching, link prediction, and more
|
|
17
|
-
- **Interactive Examples**: [Live demos](https://graphty
|
|
18
|
-
- **Performance Analysis**: [Detailed benchmarks](https://graphty
|
|
18
|
+
- **Interactive Examples**: [Live demos](https://graphty.app/algorithms/) with visualizations for all algorithms
|
|
19
|
+
- **Performance Analysis**: [Detailed benchmarks](https://graphty.app/algorithms/benchmarks/) comparing algorithm performance
|
|
19
20
|
- **Well-tested**: Extensive test suite with high coverage
|
|
20
21
|
- **Standards-compliant**: Follows conventional commits and semantic versioning
|
|
21
22
|
|
|
@@ -1027,12 +1028,12 @@ const result = grsbm(graph, {
|
|
|
1027
1028
|
|
|
1028
1029
|
## Interactive Examples
|
|
1029
1030
|
|
|
1030
|
-
Try out all algorithms with interactive visualizations: **[Live Demo →](https://graphty
|
|
1031
|
+
Try out all algorithms with interactive visualizations: **[Live Demo →](https://graphty.app/algorithms/)**
|
|
1031
1032
|
|
|
1032
1033
|
The library includes comprehensive examples demonstrating each algorithm. You can:
|
|
1033
1034
|
|
|
1034
|
-
- **[Browse Interactive HTML Examples](https://graphty
|
|
1035
|
-
- **[View Performance Benchmarks](https://graphty
|
|
1035
|
+
- **[Browse Interactive HTML Examples](https://graphty.app/algorithms/examples/)** - Visual demonstrations with step-by-step execution
|
|
1036
|
+
- **[View Performance Benchmarks](https://graphty.app/algorithms/benchmarks/)** - Comparative analysis of algorithm performance
|
|
1036
1037
|
- **[Explore Code Examples](https://github.com/graphty-org/algorithms/tree/main/examples)** - Implementation examples for each algorithm
|
|
1037
1038
|
|
|
1038
1039
|
### Basic Algorithms
|
|
@@ -1344,7 +1345,7 @@ interface GRSBMResult {
|
|
|
1344
1345
|
- GRSBM: O(m log n) where m is edges
|
|
1345
1346
|
- **Memory Usage**: O(V + E) for graph storage
|
|
1346
1347
|
- **Browser Optimization**: Algorithms use iterative approaches where possible to avoid stack overflow
|
|
1347
|
-
- **Performance Benchmarks**: View detailed performance comparisons at [https://graphty
|
|
1348
|
+
- **Performance Benchmarks**: View detailed performance comparisons at [https://graphty.app/algorithms/benchmarks/](https://graphty.app/algorithms/benchmarks/)
|
|
1348
1349
|
|
|
1349
1350
|
## Development
|
|
1350
1351
|
|
package/dist/algorithms.js
CHANGED
|
@@ -3999,7 +3999,7 @@ class BidirectionalDijkstra {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
return false;
|
|
4001
4001
|
}
|
|
4002
|
-
|
|
4002
|
+
_getMinDistance(frontier) {
|
|
4003
4003
|
if (frontier.isEmpty()) {
|
|
4004
4004
|
return Infinity;
|
|
4005
4005
|
}
|
|
@@ -10504,7 +10504,7 @@ function initializeClusterCenters(embeddings, numClusters) {
|
|
|
10504
10504
|
}
|
|
10505
10505
|
return centers;
|
|
10506
10506
|
}
|
|
10507
|
-
function updateEmbeddings(graph, embeddings,
|
|
10507
|
+
function updateEmbeddings(graph, embeddings, _clusters, learningRate, lambda) {
|
|
10508
10508
|
const gradients = /* @__PURE__ */ new Map();
|
|
10509
10509
|
for (const [nodeId, embedding] of embeddings) {
|
|
10510
10510
|
gradients.set(nodeId, new Array(embedding.length).fill(0));
|
|
@@ -11062,7 +11062,7 @@ function grsbm(graph, config = {}) {
|
|
|
11062
11062
|
explanation: explanations
|
|
11063
11063
|
};
|
|
11064
11064
|
}
|
|
11065
|
-
function spectralBisection(graph, cluster,
|
|
11065
|
+
function spectralBisection(graph, cluster, _numEigenvectors, tolerance, maxIterations) {
|
|
11066
11066
|
const members = Array.from(cluster.members);
|
|
11067
11067
|
const n = members.length;
|
|
11068
11068
|
if (n < 4) {
|