@graphty/algorithms 1.8.1 → 2.0.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 +5 -4
- package/dist/algorithms.js +518 -525
- package/dist/algorithms.js.map +1 -1
- package/dist/algorithms.standalone.js +519 -526
- package/dist/algorithms.standalone.js.map +1 -1
- package/dist/src/algorithms/centrality/eigenvector.d.ts +13 -2
- package/dist/src/algorithms/centrality/eigenvector.d.ts.map +1 -1
- package/dist/src/algorithms/centrality/eigenvector.js +96 -73
- package/dist/src/algorithms/centrality/eigenvector.js.map +1 -1
- package/dist/src/algorithms/community/girvan-newman.js +35 -15
- package/dist/src/algorithms/community/girvan-newman.js.map +1 -1
- package/dist/src/algorithms/community/leiden.d.ts.map +1 -1
- package/dist/src/algorithms/community/leiden.js +214 -222
- package/dist/src/algorithms/community/leiden.js.map +1 -1
- package/dist/src/algorithms/community/louvain-optimized.d.ts +28 -72
- package/dist/src/algorithms/community/louvain-optimized.d.ts.map +1 -1
- package/dist/src/algorithms/community/louvain-optimized.js +249 -262
- package/dist/src/algorithms/community/louvain-optimized.js.map +1 -1
- package/dist/src/algorithms/community/modularity-utils.d.ts +15 -7
- package/dist/src/algorithms/community/modularity-utils.d.ts.map +1 -1
- package/dist/src/algorithms/community/modularity-utils.js +38 -38
- package/dist/src/algorithms/community/modularity-utils.js.map +1 -1
- package/dist/src/algorithms/shortest-path/bellman-ford.d.ts.map +1 -1
- package/dist/src/algorithms/shortest-path/bellman-ford.js +35 -8
- package/dist/src/algorithms/shortest-path/bellman-ford.js.map +1 -1
- package/dist/src/errors.d.ts +21 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +23 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/algorithms/centrality/eigenvector.ts +103 -84
- package/src/algorithms/community/girvan-newman.ts +38 -17
- package/src/algorithms/community/leiden.ts +270 -275
- package/src/algorithms/community/louvain-optimized.ts +303 -313
- package/src/algorithms/community/modularity-utils.ts +42 -45
- package/src/algorithms/shortest-path/bellman-ford.ts +46 -8
- package/src/errors.ts +26 -0
- package/src/index.ts +3 -0
package/README.md
CHANGED
|
@@ -459,6 +459,9 @@ const centralities = eigenvectorCentrality(graph, {
|
|
|
459
459
|
maxIterations: number, // Default: 100
|
|
460
460
|
tolerance: number, // Default: 1e-6
|
|
461
461
|
});
|
|
462
|
+
// Throws ConvergenceError (exported) when maxIterations passes do not meet the tolerance,
|
|
463
|
+
// as networkx raises PowerIterationFailedConvergence. Long paths and large grids need more
|
|
464
|
+
// than 100 passes; raise maxIterations or tolerance and call again.
|
|
462
465
|
// Returns: CentralityResult (Record<string, number>)
|
|
463
466
|
|
|
464
467
|
// Single node eigenvector centrality
|
|
@@ -1433,14 +1436,12 @@ The project includes interactive HTML examples demonstrating each algorithm. To
|
|
|
1433
1436
|
# HOST=0.0.0.0 # For network access
|
|
1434
1437
|
# HOST=my.server.com # Custom domain
|
|
1435
1438
|
|
|
1436
|
-
# Server port (defaults to 9000)
|
|
1437
|
-
PORT=9000 # Must be between 9000-9099
|
|
1438
1439
|
```
|
|
1439
1440
|
|
|
1440
|
-
3. **Start the development server
|
|
1441
|
+
3. **Start the development server** (the port is required and comes from `PORT`):
|
|
1441
1442
|
|
|
1442
1443
|
```bash
|
|
1443
|
-
npm run examples:html
|
|
1444
|
+
PORT=9000 npm run examples:html
|
|
1444
1445
|
```
|
|
1445
1446
|
|
|
1446
1447
|
4. **Open your browser** to `http://localhost:9000` (or your configured host/port)
|