@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.
Files changed (75) hide show
  1. package/README.md +9 -11
  2. package/dist/algorithms.js +499 -30
  3. package/dist/algorithms.js.map +1 -1
  4. package/dist/algorithms.standalone.js +500 -31
  5. package/dist/algorithms.standalone.js.map +1 -1
  6. package/dist/src/algorithms/centrality/betweenness.js +2 -2
  7. package/dist/src/algorithms/centrality/betweenness.js.map +1 -1
  8. package/dist/src/algorithms/community/girvan-newman.js +1 -1
  9. package/dist/src/algorithms/community/girvan-newman.js.map +1 -1
  10. package/dist/src/algorithms/matching/isomorphism.js +3 -3
  11. package/dist/src/algorithms/matching/isomorphism.js.map +1 -1
  12. package/dist/src/algorithms/mst/prim.js +1 -1
  13. package/dist/src/algorithms/mst/prim.js.map +1 -1
  14. package/dist/src/algorithms/shortest-path/bellman-ford.js +1 -1
  15. package/dist/src/algorithms/shortest-path/bellman-ford.js.map +1 -1
  16. package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.js +1 -1
  17. package/dist/src/algorithms/shortest-path/bidirectional-dijkstra.js.map +1 -1
  18. package/dist/src/algorithms/shortest-path/dijkstra.js +1 -1
  19. package/dist/src/algorithms/shortest-path/dijkstra.js.map +1 -1
  20. package/dist/src/algorithms/traversal/bfs-unified.js +2 -2
  21. package/dist/src/algorithms/traversal/bfs-unified.js.map +1 -1
  22. package/dist/src/algorithms/traversal/dfs.js +2 -2
  23. package/dist/src/algorithms/traversal/dfs.js.map +1 -1
  24. package/dist/src/clustering/spectral.js +2 -2
  25. package/dist/src/clustering/spectral.js.map +1 -1
  26. package/dist/src/index.d.ts +4 -0
  27. package/dist/src/index.d.ts.map +1 -1
  28. package/dist/src/index.js.map +1 -1
  29. package/dist/src/indexed/accelerator.d.ts +14 -2
  30. package/dist/src/indexed/accelerator.d.ts.map +1 -1
  31. package/dist/src/indexed/accelerator.js +8 -0
  32. package/dist/src/indexed/accelerator.js.map +1 -1
  33. package/dist/src/indexed/components.d.ts +8 -0
  34. package/dist/src/indexed/components.d.ts.map +1 -1
  35. package/dist/src/indexed/components.js +8 -1
  36. package/dist/src/indexed/components.js.map +1 -1
  37. package/dist/src/indexed/hits.d.ts +39 -0
  38. package/dist/src/indexed/hits.d.ts.map +1 -0
  39. package/dist/src/indexed/hits.js +95 -0
  40. package/dist/src/indexed/hits.js.map +1 -0
  41. package/dist/src/indexed/index.d.ts +5 -1
  42. package/dist/src/indexed/index.d.ts.map +1 -1
  43. package/dist/src/indexed/index.js +5 -1
  44. package/dist/src/indexed/index.js.map +1 -1
  45. package/dist/src/indexed/k-core.d.ts +32 -0
  46. package/dist/src/indexed/k-core.d.ts.map +1 -0
  47. package/dist/src/indexed/k-core.js +118 -0
  48. package/dist/src/indexed/k-core.js.map +1 -0
  49. package/dist/src/indexed/katz.d.ts +38 -0
  50. package/dist/src/indexed/katz.d.ts.map +1 -0
  51. package/dist/src/indexed/katz.js +61 -0
  52. package/dist/src/indexed/katz.js.map +1 -0
  53. package/dist/src/indexed/louvain.d.ts +33 -0
  54. package/dist/src/indexed/louvain.d.ts.map +1 -0
  55. package/dist/src/indexed/louvain.js +301 -0
  56. package/dist/src/indexed/louvain.js.map +1 -0
  57. package/package.json +6 -6
  58. package/src/algorithms/centrality/betweenness.ts +2 -2
  59. package/src/algorithms/community/girvan-newman.ts +1 -1
  60. package/src/algorithms/matching/isomorphism.ts +3 -3
  61. package/src/algorithms/mst/prim.ts +1 -1
  62. package/src/algorithms/shortest-path/bellman-ford.ts +3 -3
  63. package/src/algorithms/shortest-path/bidirectional-dijkstra.ts +1 -1
  64. package/src/algorithms/shortest-path/dijkstra.ts +1 -1
  65. package/src/algorithms/traversal/bfs-unified.ts +2 -2
  66. package/src/algorithms/traversal/dfs.ts +2 -2
  67. package/src/clustering/spectral.ts +2 -2
  68. package/src/index.ts +10 -0
  69. package/src/indexed/accelerator.ts +26 -2
  70. package/src/indexed/components.ts +8 -1
  71. package/src/indexed/hits.ts +126 -0
  72. package/src/indexed/index.ts +5 -7
  73. package/src/indexed/k-core.ts +138 -0
  74. package/src/indexed/katz.ts +88 -0
  75. 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**: [Detailed benchmarks](https://graphty.app/algorithms/benchmarks/) comparing algorithm performance
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**: View detailed performance comparisons at [https://graphty.app/algorithms/benchmarks/](https://graphty.app/algorithms/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 repository
1376
- git clone https://github.com/graphty-org/algorithms.git
1377
- cd algorithms
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
- npm install
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