bmssp 0.5.0 → 0.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tsinghua Single Source Shortest Paths algorithm
2
2
 
3
- This is a repository containing implementation varieties based on the paper written by Duan Ran et. al. from Tsinghua University.
3
+ This is a repository containing a simple community driven implementation in Javascript based on the paper written by Duan Ran et. al. from Tsinghua University.
4
4
  "Breaking the Sorting Barrier for Directed Single-Source Shortest Paths".
5
5
 
6
6
  https://dl.acm.org/doi/10.1145/3717823.3718179
@@ -13,18 +13,9 @@ We give a deterministic O(mlog2/3n)-time algorithm for single-source shortest pa
13
13
 
14
14
  ## Development Details
15
15
 
16
- This project is mainly focused in Javascript (in order to be published to npmjs.com via github Actions).
16
+ This project is mainly focused in Javascript in order to be published to npmjs.com as a JS module (esmodule).
17
17
 
18
- ### Other Implementations
18
+ ### Other Implementations in GitHub
19
19
 
20
20
  https://github.com/search?q=bmssp&type=repositories
21
21
 
22
- Rust:
23
- - https://github.com/lucas-montes/bmssp - Available as a crate to pull.
24
-
25
- Java:
26
- - https://github.com/PatrickDiallo23/BMSSP-Java
27
-
28
- Python:
29
- - https://github.com/sidharthpunathil/fastest-shortest-path-algo-poc
30
- - https://github.com/simpsonresearch/tsinghua_benchmarks/tree/main
package/docs/index.html CHANGED
@@ -72,7 +72,7 @@
72
72
  Implementation of the Single Source Shortest Path (SSSP) algorithm - Bounded Multiple Source Shortest Paths (BMSSP), originally published by Tsinghua University's research.
73
73
  </p>
74
74
  <p>
75
- Read the original paper:
75
+ Read the original paper:
76
76
  <a href="https://dl.acm.org/doi/10.1145/3717823.3718179" target="_blank">
77
77
  Tsinghua SSSP Paper
78
78
  </a>
@@ -93,4 +93,4 @@
93
93
  <a class="btn" href="https://github.com/sirivasv/tsinghua-sssp" target="_blank">View on GitHub</a>
94
94
  </div>
95
95
  </body>
96
- </html></svg>
96
+ </html></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmssp",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Javascript package implementation of the bmssp algorithm.",
5
5
  "keywords": [
6
6
  "shortest-paths",
@@ -19,11 +19,34 @@
19
19
  "license": "MPL-2.0",
20
20
  "author": "Saul Ivan Rivas Vega",
21
21
  "type": "module",
22
- "main": "index.js",
23
22
  "directories": {
24
23
  "doc": "docs"
25
24
  },
25
+ "files": [
26
+ "src/",
27
+ "docs/",
28
+ "package.json",
29
+ "package-lock.json",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
26
33
  "scripts": {
27
- "test": "node tests/main.js"
34
+ "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage",
35
+ "lint": "npm run prettier && npm run eslint",
36
+ "format": "npm run prettier:fix && npm run eslint:fix",
37
+ "eslint": "eslint --max-warnings=0 .",
38
+ "eslint:fix": "eslint --fix .",
39
+ "prettier": "prettier --check \"./**/{*.js,*.mjs}\"",
40
+ "prettier:fix": "prettier --write \"./**/{*.js,*.mjs}\""
41
+ },
42
+ "devDependencies": {
43
+ "@eslint/js": "^9.34.0",
44
+ "@eslint/markdown": "^7.2.0",
45
+ "eslint": "^9.34.0",
46
+ "eslint-config-prettier": "^10.1.8",
47
+ "eslint-plugin-prettier": "^5.5.4",
48
+ "globals": "^16.3.0",
49
+ "jest": "^30.1.1",
50
+ "prettier": "3.6.2"
28
51
  }
29
52
  }
package/src/bmssp.mjs CHANGED
@@ -1,5 +1,9 @@
1
1
  function printMessage(message) {
2
- console.log(message);
2
+ return message;
3
3
  }
4
4
 
5
- export { printMessage };
5
+ function processMessage(message) {
6
+ return `Processed: ${message}`;
7
+ }
8
+
9
+ export { printMessage, processMessage };
@@ -1,19 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "docker"
9
- directory: "/"
10
- schedule:
11
- interval: "weekly"
12
- - package-ecosystem: "npm" # See documentation for possible values
13
- directory: "/" # Location of package manifests
14
- schedule:
15
- interval: "weekly"
16
- - package-ecosystem: "github-actions"
17
- directory: "/"
18
- schedule:
19
- interval: "weekly"
@@ -1,49 +0,0 @@
1
- name: Build and publish Docker image
2
-
3
- on:
4
- push:
5
- tags:
6
- - '*.*.*'
7
-
8
- jobs:
9
- docker-build-and-publish:
10
- environment:
11
- name: dockerhub
12
- permissions:
13
- contents: read
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: Docker meta
17
- id: meta
18
- uses: docker/metadata-action@v5
19
- with:
20
- # list of Docker images to use as base name for tags
21
- images: |
22
- sirivasv/bmssp-js
23
- # generate Docker tags based on the following events/attributes
24
- tags: |
25
- type=semver,pattern={{version}}
26
- type=semver,pattern={{major}}.{{minor}}
27
- type=semver,pattern={{major}}
28
- - name: Checkout
29
- uses: actions/checkout@v5
30
-
31
- - name: Login to Docker Hub
32
- uses: docker/login-action@v3
33
- with:
34
- username: ${{ secrets.DOCKERHUB_USERNAME }}
35
- password: ${{ secrets.DOCKERHUB_TOKEN }}
36
-
37
- - name: Set up QEMU
38
- uses: docker/setup-qemu-action@v3
39
-
40
- - name: Set up Docker Buildx
41
- uses: docker/setup-buildx-action@v3
42
-
43
- - name: Build and push
44
- uses: docker/build-push-action@v6
45
- with:
46
- context: .
47
- platforms: linux/amd64,linux/arm64
48
- push: true
49
- tags: ${{ steps.meta.outputs.tags }}
@@ -1,24 +0,0 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build-and-publish:
7
- environment:
8
- name: npm-bmssp
9
- runs-on: ubuntu-latest
10
- permissions:
11
- contents: read
12
- id-token: write
13
- steps:
14
- - uses: actions/checkout@v5
15
- # Setup .npmrc file to publish to npm
16
- - uses: actions/setup-node@v4
17
- with:
18
- node-version: '24.x'
19
- registry-url: 'https://registry.npmjs.org'
20
- - run: npm test
21
- - run: npm ci
22
- - run: npm publish --provenance --access public
23
- env:
24
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,45 +0,0 @@
1
- # Simple workflow for deploying static content to GitHub Pages
2
- name: Deploy static content to Pages
3
-
4
- on:
5
- # Runs on pushes targeting the default branch
6
- push:
7
- branches: ["main"]
8
- paths:
9
- - 'docs/**'
10
-
11
- # Allows you to run this workflow manually from the Actions tab
12
- workflow_dispatch:
13
-
14
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15
- permissions:
16
- contents: read
17
- pages: write
18
- id-token: write
19
-
20
- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21
- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22
- concurrency:
23
- group: "pages"
24
- cancel-in-progress: false
25
-
26
- jobs:
27
- # Single deploy job since we're just deploying
28
- deploy:
29
- environment:
30
- name: github-pages
31
- url: ${{ steps.deployment.outputs.page_url }}
32
- runs-on: ubuntu-latest
33
- steps:
34
- - name: Checkout
35
- uses: actions/checkout@v5
36
- - name: Setup Pages
37
- uses: actions/configure-pages@v5
38
- - name: Upload artifact
39
- uses: actions/upload-pages-artifact@v4
40
- with:
41
- # Upload entire repository
42
- path: 'docs/'
43
- - name: Deploy to GitHub Pages
44
- id: deployment
45
- uses: actions/deploy-pages@v4
package/Dockerfile DELETED
@@ -1,13 +0,0 @@
1
- FROM node:24-alpine
2
-
3
- WORKDIR /app
4
-
5
- # Copy package files and install dependencies
6
- COPY package*.json ./
7
- RUN npm install
8
-
9
- # Mount src/ directory as a volume
10
- VOLUME ["src/", "tests/"]
11
-
12
- # Default command (can be overridden)
13
- CMD ["node", "tests/main.js"]
package/tests/main.js DELETED
@@ -1,12 +0,0 @@
1
- import { printMessage } from "../src/bmssp.mjs";
2
-
3
- function testFunction() {
4
- try {
5
- const result = printMessage("Hello, World!");
6
- console.log('Test passed:', result);
7
- } catch (error) {
8
- console.error('Test failed:', error.message);
9
- }
10
- }
11
-
12
- testFunction();