Skip to content

Commit daff06f

Browse files
committed
Initial import: JGraphT algorithm visualizations
Self-contained, single-page HTML visualizations of graph algorithms implemented in JGraphT. Migrated from seilat/jgrapht @ visualizations branch (12 commits squashed into this initial import). Layout flattened: files previously under visualizations/ now sit at repo root so GitHub Pages and the Docker image serve from /. Modes covered: - K-shortest paths (Yen) — pickable pane A/B from five algorithms: Yen+Dijkstra, Yen+A*, BPYen+Dijkstra, BPYen+A*, Eppstein. - Single shortest path — Dijkstra vs A* with reverse-Dijkstra heuristic. - All paths — AllDirectedPaths backward-BFS baseline vs forward pruning (the "sandwich" gate: forward-reachability + budget). Dual-licensed LGPL-2.1-or-later OR EPL-2.0, matching JGraphT.
0 parents  commit daff06f

16 files changed

Lines changed: 3693 additions & 0 deletions

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.git
2+
.github
3+
.gitignore
4+
.nojekyll
5+
README.md
6+
CONTRIBUTING.md
7+
CODE_OF_CONDUCT.md
8+
license-EPL.txt
9+
license-LGPL.txt
10+
docker-compose.yml
11+
.dockerignore
12+
vercel.json

.github/workflows/pages.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Pages
28+
uses: actions/configure-pages@v5
29+
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
# Publish the repo root as the site. .nojekyll disables Jekyll.
34+
path: '.'
35+
36+
- name: Deploy
37+
id: deployment
38+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OS / editor noise
2+
.DS_Store
3+
Thumbs.db
4+
*.swp
5+
.idea/
6+
.vscode/
7+
*.iml
8+
9+
# Local dev servers / dumps
10+
node_modules/
11+
.cache/
12+
.tmp/
13+
*.log

.nojekyll

Whitespace-only changes.

CODE_OF_CONDUCT.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and committers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
* Proactively reading, following, and improving community guidelines
23+
24+
Examples of unacceptable behavior by participants include:
25+
26+
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
advances
28+
* Trolling, insulting/derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or electronic
31+
address, without explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project committers are responsible for clarifying the standards of acceptable
38+
behavior and are expected to take appropriate and fair corrective action in
39+
response to any instances of unacceptable behavior.
40+
41+
Project committers have the right and responsibility to remove, edit, or
42+
reject comments, commits, code, wiki edits, issues, and other contributions
43+
that are not aligned to this Code of Conduct, or to ban temporarily or
44+
permanently any contributor for other behaviors that they deem inappropriate,
45+
threatening, offensive, or harmful.
46+
47+
## Contribution Model
48+
49+
In the JGraphT project, we use the term "committers" rather than "maintainers".
50+
51+
This is because other than release management, most project maintenance is done through contributions,
52+
rather than through work carried out by a dedicated team. Committers
53+
help contributors carry this out through processes such as issue discussions
54+
and code review. Committers generally do not even commit their own work directly;
55+
instead, they wait for another committer to review and merge their contributions.
56+
57+
Understanding and respecting these roles is an important aspect of our
58+
code of conduct.
59+
60+
## Scope
61+
62+
This Code of Conduct applies both within project spaces and in public spaces
63+
when an individual is representing the project or its community. Examples of
64+
representing a project or community include using an official project e-mail
65+
address, posting via an official social media account, or acting as an appointed
66+
representative at an online or offline event. Representation of a project may be
67+
further defined and clarified by project committers.
68+
69+
## Enforcement
70+
71+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
72+
reported by contacting the project team at admin@jgrapht.org. All
73+
complaints will be reviewed and investigated and will result in a response that
74+
is deemed necessary and appropriate to the circumstances. The project team is
75+
obligated to maintain confidentiality with regard to the reporter of an incident.
76+
Further details of specific enforcement policies may be posted separately.
77+
78+
Project committers who do not follow or enforce the Code of Conduct in good
79+
faith may face temporary or permanent repercussions as determined by other
80+
members of the project's leadership.
81+
82+
## Attribution
83+
84+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
85+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
86+
87+
[homepage]: https://www.contributor-covenant.org
88+
89+
For answers to common questions about this code of conduct, see
90+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributing
2+
3+
Thanks for your interest in improving the JGraphT algorithm visualizations.
4+
5+
## Where to discuss
6+
7+
Before opening a non-trivial PR, please post a short heads-up to the
8+
[`jgrapht-dev` Google Group](https://groups.google.com/g/jgrapht-dev) with a
9+
link to your branch. This is the same convention used by the main
10+
[JGraphT][jgrapht] repository — it keeps the contributor pool small enough that
11+
async review on the list works well.
12+
13+
For bug reports and small fixes, a GitHub issue or PR is fine.
14+
15+
We follow the [JGraphT Code of Conduct](CODE_OF_CONDUCT.md).
16+
17+
[jgrapht]: https://github.com/jgrapht/jgrapht
18+
19+
## What fits in this repository
20+
21+
This repo hosts **interactive teaching visualizations** of algorithms that are
22+
implemented (or being proposed) in JGraphT. Good fits:
23+
24+
- A new algorithm pair (baseline vs. variant) that can be stepped through
25+
side by side and explained event-by-event.
26+
- A new graph example that exposes a subtle correctness or performance edge
27+
case in an existing visualization.
28+
- UX polish: clearer per-step explanations, glossary entries, accessibility
29+
fixes, layout improvements.
30+
31+
What does **not** fit:
32+
33+
- Full Java/JGraphT algorithm code — that belongs in
34+
[`jgrapht/jgrapht`](https://github.com/jgrapht/jgrapht).
35+
- Pure benchmarking infrastructure — also belongs in the main repository.
36+
- Animations of algorithms that are not in (or proposed for) JGraphT.
37+
38+
## Design constraints
39+
40+
The page is intentionally a single self-contained HTML file (HTML + inline CSS
41+
+ inline JS, no external dependencies, no build step). This keeps the deploy
42+
surface tiny. PRs that add external runtime
43+
dependencies will need a strong motivation; please raise on the mailing list
44+
first.
45+
46+
It is acceptable for the file to grow, but please:
47+
48+
- Keep all event-driven animation work behind a step queue (don't `setTimeout`
49+
ad-hoc) — match the existing pattern.
50+
- Keep per-step explanations short and accurate; if an explanation is wrong
51+
on any example, that's a correctness bug.
52+
- Match the existing colour / pane / glossary conventions so that modes feel
53+
consistent.
54+
55+
## Pull request checklist
56+
57+
- [ ] I posted a heads-up on `jgrapht-dev` for non-trivial changes.
58+
- [ ] The page still opens cleanly in modern Chrome / Firefox / Safari from a
59+
plain `file://` path **and** via `python -m http.server`.
60+
- [ ] All animation steps display a non-empty, accurate explanation.
61+
- [ ] If I added a new algorithm pair, the two panes agree on optimal-path
62+
sets (with the documented Yen tie-break caveat) on every supplied
63+
example.
64+
- [ ] No new external runtime dependencies (or I've discussed them on
65+
`jgrapht-dev` first).
66+
- [ ] My commit messages follow Conventional Commits
67+
(`feat: ...`, `fix: ...`, `docs: ...`, `chore: ...`, `refactor: ...`).
68+
Scope is optional but should be the algorithm or mode when it helps
69+
(e.g. `feat(eppstein): ...`, `fix(forward-pruning): ...`).
70+
71+
## License
72+
73+
By contributing, you agree that your contributions will be dual-licensed under
74+
the same terms as the project itself:
75+
76+
- GNU Lesser General Public License (LGPL) 2.1
77+
- Eclipse Public License (EPL) 2.0
78+
79+
`SPDX-License-Identifier: LGPL-2.1-or-later OR EPL-2.0`

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# JGraphT algorithm visualizations: Yen / Eppstein K-shortest paths,
2+
# Dijkstra vs A*, and AllDirectedPaths forward pruning. Single
3+
# self-contained HTML file served by nginx-alpine.
4+
FROM nginx:1.27-alpine
5+
6+
# Run as non-root for safer deployment.
7+
RUN addgroup -S app && adduser -S -G app app \
8+
&& touch /var/run/nginx.pid \
9+
&& chown -R app:app /var/cache/nginx /var/run/nginx.pid /usr/share/nginx/html /etc/nginx/conf.d
10+
11+
COPY --chown=app:app index.html /usr/share/nginx/html/index.html
12+
COPY --chown=app:app favicon.ico /usr/share/nginx/html/favicon.ico
13+
COPY --chown=app:app apple-touch-icon.png /usr/share/nginx/html/apple-touch-icon.png
14+
COPY --chown=app:app nginx.conf /etc/nginx/conf.d/default.conf
15+
16+
USER app
17+
18+
EXPOSE 8080
19+
20+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
21+
CMD wget -q --spider http://127.0.0.1:8080/ || exit 1
22+
23+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)