@graphty/algorithms 2.0.6 → 2.1.1
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 +9 -11
- package/dist/algorithms.js +499 -30
- package/dist/algorithms.js.map +1 -1
- package/dist/algorithms.standalone.js +500 -31
- package/dist/algorithms.standalone.js.map +1 -1
- package/dist/src/algorithms/centrality/betweenness.js +2 -2
- package/dist/src/algorithms/centrality/betweenness.js.map +1 -1
- package/dist/src/algorithms/community/girvan-newman.js +1 -1
- package/dist/src/algorithms/community/girvan-newman.js.map +1 -1
- package/dist/src/algorithms/matching/isomorphism.js +3 -3
- package/dist/src/algorithms/matching/isomorphism.js.map +1 -1
- package/dist/src/algorithms/mst/prim.js +1 -1
- package/dist/src/algorithms/mst/prim.js.map +1 -1
- package/dist/src/algorithms/shortest-path/bellman-ford.js +1 -1
- package/dist/src/algorithms/shortest-path/bellman-ford.js.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/algorithms/shortest-path/dijkstra.js +1 -1
- package/dist/src/algorithms/shortest-path/dijkstra.js.map +1 -1
- package/dist/src/algorithms/traversal/bfs-unified.js +2 -2
- package/dist/src/algorithms/traversal/bfs-unified.js.map +1 -1
- package/dist/src/algorithms/traversal/dfs.js +2 -2
- package/dist/src/algorithms/traversal/dfs.js.map +1 -1
- package/dist/src/clustering/spectral.js +2 -2
- package/dist/src/clustering/spectral.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/indexed/accelerator.d.ts +14 -2
- package/dist/src/indexed/accelerator.d.ts.map +1 -1
- package/dist/src/indexed/accelerator.js +8 -0
- package/dist/src/indexed/accelerator.js.map +1 -1
- package/dist/src/indexed/components.d.ts +8 -0
- package/dist/src/indexed/components.d.ts.map +1 -1
- package/dist/src/indexed/components.js +8 -1
- package/dist/src/indexed/components.js.map +1 -1
- package/dist/src/indexed/hits.d.ts +39 -0
- package/dist/src/indexed/hits.d.ts.map +1 -0
- package/dist/src/indexed/hits.js +95 -0
- package/dist/src/indexed/hits.js.map +1 -0
- package/dist/src/indexed/index.d.ts +5 -1
- package/dist/src/indexed/index.d.ts.map +1 -1
- package/dist/src/indexed/index.js +5 -1
- package/dist/src/indexed/index.js.map +1 -1
- package/dist/src/indexed/k-core.d.ts +32 -0
- package/dist/src/indexed/k-core.d.ts.map +1 -0
- package/dist/src/indexed/k-core.js +118 -0
- package/dist/src/indexed/k-core.js.map +1 -0
- package/dist/src/indexed/katz.d.ts +38 -0
- package/dist/src/indexed/katz.d.ts.map +1 -0
- package/dist/src/indexed/katz.js +61 -0
- package/dist/src/indexed/katz.js.map +1 -0
- package/dist/src/indexed/louvain.d.ts +33 -0
- package/dist/src/indexed/louvain.d.ts.map +1 -0
- package/dist/src/indexed/louvain.js +301 -0
- package/dist/src/indexed/louvain.js.map +1 -0
- package/package.json +6 -6
- package/src/algorithms/centrality/betweenness.ts +2 -2
- package/src/algorithms/community/girvan-newman.ts +1 -1
- package/src/algorithms/matching/isomorphism.ts +3 -3
- package/src/algorithms/mst/prim.ts +1 -1
- package/src/algorithms/shortest-path/bellman-ford.ts +3 -3
- package/src/algorithms/shortest-path/bidirectional-dijkstra.ts +1 -1
- package/src/algorithms/shortest-path/dijkstra.ts +1 -1
- package/src/algorithms/traversal/bfs-unified.ts +2 -2
- package/src/algorithms/traversal/dfs.ts +2 -2
- package/src/clustering/spectral.ts +2 -2
- package/src/index.ts +10 -0
- package/src/indexed/accelerator.ts +26 -2
- package/src/indexed/components.ts +8 -1
- package/src/indexed/hits.ts +126 -0
- package/src/indexed/index.ts +5 -7
- package/src/indexed/k-core.ts +138 -0
- package/src/indexed/katz.ts +88 -0
- package/src/indexed/louvain.ts +345 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ A comprehensive TypeScript graph algorithms library with 98 algorithms optimized
|
|
|
17
17
|
- **Modular**: Import only the algorithms you need
|
|
18
18
|
- **Comprehensive**: 98 graph algorithms including traversal, shortest paths, centrality, clustering, flow, matching, link prediction, and more
|
|
19
19
|
- **Interactive Examples**: [Live demos](https://graphty.app/algorithms/) with visualizations for all algorithms
|
|
20
|
-
- **Performance Analysis**:
|
|
20
|
+
- **Performance Analysis**: `npm run benchmark` benchmarks every algorithm locally
|
|
21
21
|
- **Well-tested**: Extensive test suite with high coverage
|
|
22
22
|
- **Standards-compliant**: Follows conventional commits and semantic versioning
|
|
23
23
|
|
|
@@ -1036,6 +1036,7 @@ const result = grsbm(graph, {
|
|
|
1036
1036
|
Explore algorithms with interactive Storybook demos: **[View Storybook →](https://graphty.app/storybook/algorithms/)**
|
|
1037
1037
|
|
|
1038
1038
|
Storybook provides:
|
|
1039
|
+
|
|
1039
1040
|
- **Animated visualizations** showing how each algorithm works step-by-step
|
|
1040
1041
|
- **Interactive controls** to modify parameters and graph types
|
|
1041
1042
|
- **Deterministic output** with seeded randomness for reproducibility
|
|
@@ -1048,7 +1049,6 @@ Try out all algorithms with interactive visualizations: **[Live Demo →](https:
|
|
|
1048
1049
|
The library includes comprehensive examples demonstrating each algorithm. You can:
|
|
1049
1050
|
|
|
1050
1051
|
- **[Browse Interactive HTML Examples](https://graphty.app/algorithms/examples/)** - Visual demonstrations with step-by-step execution
|
|
1051
|
-
- **[View Performance Benchmarks](https://graphty.app/algorithms/benchmarks/)** - Comparative analysis of algorithm performance
|
|
1052
1052
|
- **[Explore Code Examples](https://github.com/graphty-org/graphty-monorepo/tree/master/algorithms/examples)** - Implementation examples for each algorithm
|
|
1053
1053
|
|
|
1054
1054
|
### Basic Algorithms
|
|
@@ -1360,7 +1360,7 @@ interface GRSBMResult {
|
|
|
1360
1360
|
- GRSBM: O(m log n) where m is edges
|
|
1361
1361
|
- **Memory Usage**: O(V + E) for graph storage
|
|
1362
1362
|
- **Browser Optimization**: Algorithms use iterative approaches where possible to avoid stack overflow
|
|
1363
|
-
- **Performance Benchmarks**:
|
|
1363
|
+
- **Performance Benchmarks**: run `npm run benchmark` in algorithms/ to compare algorithm performance locally
|
|
1364
1364
|
|
|
1365
1365
|
## Development
|
|
1366
1366
|
|
|
@@ -1372,15 +1372,13 @@ interface GRSBMResult {
|
|
|
1372
1372
|
### Setup
|
|
1373
1373
|
|
|
1374
1374
|
```bash
|
|
1375
|
-
# Clone the
|
|
1376
|
-
git clone https://github.com/graphty-org/
|
|
1377
|
-
cd
|
|
1375
|
+
# Clone the monorepo (the package lives in algorithms/)
|
|
1376
|
+
git clone https://github.com/graphty-org/graphty-monorepo.git
|
|
1377
|
+
cd graphty-monorepo
|
|
1378
1378
|
|
|
1379
|
-
# Install dependencies
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
# Set up git hooks
|
|
1383
|
-
npm run prepare
|
|
1379
|
+
# Install dependencies for every package
|
|
1380
|
+
pnpm install
|
|
1381
|
+
cd algorithms
|
|
1384
1382
|
```
|
|
1385
1383
|
|
|
1386
1384
|
### Scripts
|