|
1 |
| -### AntV Algorithm |
| 1 | +<h1 align="center"> |
| 2 | +<b>AntV Algorithm</b> |
| 3 | +</h1> |
2 | 4 |
|
3 |
| -It is an algorithm package of AntV, mainly includes graph related algorithms: |
4 |
| -- **Community Detection** |
5 |
| - - k-core: K-Core community detection algorithm -- Find the closely related subgraph structure that conforms to the specified core degree K |
6 |
| - - louvain: LOUVAIN algorithm -- Divide communities according to Modularity |
7 |
| - - i-louvain: I-LOUVAIN algorithm -- Divide communities according to Modularity and Inertial Modularity (properties similarity) |
8 |
| - - labelPropagation: Label Propagation(LP) clustering algorithm |
9 |
| - - minimumSpanningTree: Generate the minimum spanning tree for a graph |
| 5 | +[](https://github.com/antvis//actions) |
| 6 | +[](https://coveralls.io/github/antvis/algorithm?branch=next) |
| 7 | +[](https://www.npmjs.com/package/@antv/graph) |
| 8 | +[](https://www.npmjs.com/package/@antv/graph) |
10 | 9 |
|
11 |
| -- **nodes clustering** |
12 |
| - - k-means: K-Means algorithm - Cluster nodes into K clusters according to the distance between node |
| 10 | +- [@antv/graph](./packages/graph/README.md) [](https://www.npmjs.com/package/@antv/graph) Implemented with TypeScript. [Online Demo](https://observablehq.com/d/2db6b0cc5e97d8d6) |
| 11 | +- [@antv/graph-rust](./packages/graph-rust/README.md) Implemented with Rust. |
| 12 | +- [@antv/graph-wasm](./packages/graph-wasm/README.md) [](https://www.npmjs.com/package/@antv/graph-wasm) Provide a WASM binding of `@antv/graph-rust`. [Online Demo](https://observablehq.com/d/288c16a54543a141) |
| 13 | +- [@antv/graph-gpu](./packages/graph-gpu/README.md) [](https://www.npmjs.com/package/@antv/graph-gpu) Accelerate some parallelizable algorithms such as Fruchterman with WebGPU which has a better performance under large amount of data. |
13 | 14 |
|
14 |
| -- **Similarity** |
15 |
| - - cosineSimilarity: Cosine Similarity algorithm -- Calculate cosine similarity |
16 |
| - - nodesCosineSimilarity: Nodes Cosine Similarity algorithm -- Calculate the cosine similarity between other nodes and seed node |
| 15 | +It is an algorithm package of AntV, mainly includes graph related algorithms: |
17 | 16 |
|
18 | 17 | - **Centrality**
|
19 | 18 | - pageRank: page rank algorithm for nodes ranking
|
20 |
| - - degree: calculate the in degree, out degree, and total degree for nodes |
21 |
| - |
22 |
| -- **Path** |
23 |
| - - dijkstra: Dijkstra shortest path algorithm |
24 |
| - - findPath: Find the shortest paths and all paths for two nodes by Dijkstra |
25 |
| - - floydWarshall: Floyd Warshall shortest path algorithm |
26 |
| - |
27 |
| -- **Other** |
28 |
| - - neighbors: Find the neighbors for a node in the graph |
29 |
| - - GADDI: graph structural and semantic pattern matching algorithm |
30 |
| - - detectCycle: Detect the cycles of the graph data |
31 |
| - - dfs: Depth-First search algorithm |
32 |
| - - adjacentMatrix: calculate the adjacency matrix for graph data |
33 |
| - - connectedComponent: Calculate the connected components for graph data |
34 |
| - |
35 |
| -All the algorithms above supports to be calculated with web-worker. |
| 19 | + |
| 20 | +## Development |
| 21 | + |
| 22 | +We use [Vite](https://vitejs.dev/) to start a dev server: |
| 23 | + |
| 24 | +```bash |
| 25 | +$ pnpm dev |
| 26 | +``` |
| 27 | + |
| 28 | +## Test |
| 29 | + |
| 30 | +Run all the test cases with Jest: |
| 31 | + |
| 32 | +```bash |
| 33 | +$ pnpm test |
| 34 | +``` |
| 35 | + |
| 36 | +## Publish |
| 37 | + |
| 38 | +Using Changesets with pnpm: https://pnpm.io/next/using-changesets |
| 39 | + |
| 40 | +The generated markdown files in the .changeset directory should be committed to the repository. |
| 41 | + |
| 42 | +```bash |
| 43 | +pnpm changeset |
| 44 | +``` |
| 45 | + |
| 46 | +This will bump the versions of the packages previously specified with pnpm changeset (and any dependents of those) and update the changelog files. |
| 47 | + |
| 48 | +```bash |
| 49 | +pnpm changeset version |
| 50 | +``` |
| 51 | + |
| 52 | +Commit the changes. This command will publish all packages that have bumped versions not yet present in the registry. |
| 53 | + |
| 54 | +```bash |
| 55 | +pnpm publish -r |
| 56 | +``` |
| 57 | + |
| 58 | +If you want to publish versions for test: |
| 59 | + |
| 60 | +```bash |
| 61 | +pnpm changeset pre enter alpha |
| 62 | +pnpm changeset pre enter beta |
| 63 | +pnpm changeset pre enter rc |
| 64 | +``` |
0 commit comments