Skip to content

Commit 5bd420f

Browse files
first release
0 parents  commit 5bd420f

File tree

5 files changed

+832
-0
lines changed

5 files changed

+832
-0
lines changed

.gitignore

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional stylelint cache
57+
.stylelintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variable files
69+
.env
70+
.env.*
71+
!.env.example
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
out
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
.output
85+
86+
# Gatsby files
87+
.cache/
88+
# Comment in the public line in if your project uses Gatsby and not Next.js
89+
# https://nextjs.org/blog/next-9-1#public-directory-support
90+
# public
91+
92+
# vuepress build output
93+
.vuepress/dist
94+
95+
# vuepress v2.x temp and cache directory
96+
.temp
97+
.cache
98+
99+
# Sveltekit cache directory
100+
.svelte-kit/
101+
102+
# vitepress build output
103+
**/.vitepress/dist
104+
105+
# vitepress cache directory
106+
**/.vitepress/cache
107+
108+
# Docusaurus cache and generated files
109+
.docusaurus
110+
111+
# Serverless directories
112+
.serverless/
113+
114+
# FuseBox cache
115+
.fusebox/
116+
117+
# DynamoDB Local files
118+
.dynamodb/
119+
120+
# Firebase cache directory
121+
.firebase/
122+
123+
# TernJS port file
124+
.tern-port
125+
126+
# Stores VSCode versions used for testing VSCode extensions
127+
.vscode-test
128+
129+
# yarn v3
130+
.pnp.*
131+
.yarn/*
132+
!.yarn/patches
133+
!.yarn/plugins
134+
!.yarn/releases
135+
!.yarn/sdks
136+
!.yarn/versions
137+
138+
# Vite files
139+
vite.config.js.timestamp-*
140+
vite.config.ts.timestamp-*
141+
.vite/
142+
143+
.DS_Store

CODE_OF_CONDUCT.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Code of Conduct
2+
3+
This repository ("duan-ssp") implements the Duan et al. directed SSSP algorithm. All contributors, maintainers, and participants are expected to follow this Code of Conduct.
4+
5+
## Expected behavior
6+
7+
- Be respectful, constructive and professional.
8+
- Report bugs, propose changes, and ask questions politely.
9+
- Attribute ideas and follow licensing requirements.
10+
11+
## Unacceptable behavior
12+
13+
- Harassment, abusive language, hate speech, threats, or doxxing.
14+
- Abusive comments, repeated unwanted contact, or offensive images.
15+
- Publicly sharing private or sensitive information about others.
16+
17+
## Reporting
18+
19+
If you experience or witness unacceptable behavior, open an issue labeled `conduct` or contact the maintainers via the repository issue tracker with relevant details. Reports will be treated confidentially when possible.
20+
21+
## Enforcement
22+
23+
Maintainers may remove content, close issues or PRs, issue warnings, or block accounts at their discretion to maintain a safe and productive project.
24+
25+
## Scope
26+
27+
Applies to all project spaces (issues, pull requests, discussions, code, and community channels) and contributors representing the project externally.
28+
29+
Thank you for helping keep this project welcoming and productive.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# duan-sssp
2+
3+
Deterministic O(m \* log^(2/3) n) directed Single-Source Shortest Path (SSSP) algorithm implementation in JavaScript.
4+
5+
Author: CodeClever
6+
7+
## Install
8+
9+
npm:
10+
11+
```
12+
npm install duan-sssp
13+
14+
```
15+
16+
## Usage
17+
18+
```js
19+
const { Graph } = require("duan-sssp");
20+
21+
const graph = new Graph(4);
22+
graph.addEdge(0, 1, 2);
23+
graph.addEdge(0, 2, 5);
24+
25+
graph.addEdge(1, 2, 1);
26+
graph.addEdge(1, 3, 2);
27+
graph.addEdge(2, 3, 1);
28+
29+
// Get full shortest path
30+
const path = graph.getPath(0, 3); // Returns [0, 1, 3]
31+
32+
console.log("shortest path", path);
33+
```
34+
35+
## License
36+
37+
This project is published under MIT License.

0 commit comments

Comments
 (0)