pax_global_header 0000666 0000000 0000000 00000000064 14424254415 0014517 g ustar 00root root 0000000 0000000 52 comment=fe2d4cdfa42073eb1141e789844adc9c1fc8bf36
jgrapht-jgrapht-1.5.2/ 0000775 0000000 0000000 00000000000 14424254415 0014620 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/.editorconfig 0000664 0000000 0000000 00000000232 14424254415 0017272 0 ustar 00root root 0000000 0000000 root = true
[*]
charset = utf-8
ident_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
jgrapht-jgrapht-1.5.2/.github/ 0000775 0000000 0000000 00000000000 14424254415 0016160 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000000270 14424254415 0020664 0 ustar 00root root 0000000 0000000
```
* JGraphT version:
* Java version (java -version)/platform:
```
**Issue**
**Steps to reproduce (small coding example)**
**Expected behaviour**
**Other information**
jgrapht-jgrapht-1.5.2/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000001715 14424254415 0021765 0 ustar 00root root 0000000 0000000
----
- [ ] I read and understood
- [ ] I read and understood
- [ ] I added [unit tests](https://github.com/jgrapht/jgrapht/wiki/Unit-testing)
- [ ] I added [documentation](https://github.com/jgrapht/jgrapht/wiki/How-to-write-documentation)
- [ ] I followed the [Coding and Style Conventions](https://github.com/jgrapht/jgrapht/wiki/Coding-and-Style-Conventions)
- [ ] I **have not** modified `HISTORY.md` or `CONTRIBUTORS.md`
- [ ] I ensured that [the git commit message is a good one](https://github.com/joelparkerhenderson/git_commit_message)
jgrapht-jgrapht-1.5.2/.github/workflows/ 0000775 0000000 0000000 00000000000 14424254415 0020215 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/.github/workflows/PR-workflow.yaml 0000664 0000000 0000000 00000001427 14424254415 0023276 0 ustar 00root root 0000000 0000000 name: JGrapht Pull Request build
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: |
set -e
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V && mvn verify -B && mvn javadoc:aggregate && mvn checkstyle:check -P checkstyle
jgrapht-jgrapht-1.5.2/.github/workflows/master-workflow.yaml 0000664 0000000 0000000 00000003111 14424254415 0024240 0 ustar 00root root 0000000 0000000 name: JGrapht Master build
on:
push:
branches:
- master
paths-ignore:
- 'CONTRIBUTORS.md'
- 'HISTORY.md'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: |
set -e
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V && mvn verify -B && mvn javadoc:aggregate && mvn checkstyle:check -P checkstyle
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm install -g hercule@5.0.0
- name: Run prepareDocs script
run: ./etc/prepareDocs.sh
shell: bash
- name: Deploy snapshot to Sonatype
env:
SONATYPE_USER: ${{ secrets.CI_DEPLOY_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
run: mvn deploy -DskipTests=true --settings etc/snapshot-settings.xml
shell: bash
- name: Publish Github Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
token: ${{ secrets.PAGES_TOKEN }}
branch: gh-pages
folder: docs
clean: true
jgrapht-jgrapht-1.5.2/.gitignore 0000664 0000000 0000000 00000000566 14424254415 0016617 0 ustar 00root root 0000000 0000000 # default crapfile-ignores
*~
*.*bak*
*.old*
*.log*
*_log_*
*.bz2
*.gz
*.xz
*.tar
*.zip
*.nbm
*.orig
*.swp*
*.*-swp
*.db
*.jar
*Kopie*
nbproject/private
one-jar
target
build
.cache
.settings
.project
.kdev4
.buildpath
.svn
.idea/*
*.iml
out/*
**/out/*
**/bin/*
pom.xml.releaseBackup
**/pom.xml.releaseBackup
**/dependency-reduced-pom.xml
.classpath
docs/javadoc*
docs/_site
jgrapht-jgrapht-1.5.2/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000007666 14424254415 0017436 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and committers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
* Proactively reading, following, and improving community guidelines
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project committers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project committers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Contribution Model
In the JGraphT project, we use the term "committers" rather than "maintainers".
This is because other than release management, most project maintenance is done through contributions,
rather than through work carried out by a dedicated team. Committers
help contributors carry this out through processes such as issue discussions
and code review. Committers generally do not even commit their own work directly;
instead, they wait for another committer to review and merge their contributions.
Understanding and respecting these roles is an important aspect of our
code of conduct.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project committers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at admin@jgrapht.org. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project committers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
jgrapht-jgrapht-1.5.2/CONTRIBUTING.md 0000664 0000000 0000000 00000001432 14424254415 0017051 0 ustar 00root root 0000000 0000000 Thanks for your interest in improving JGraphT.:+1::tada:
Before preparing your first pull request, please take a look at our
[developer guidelines wiki](https://github.com/jgrapht/jgrapht/wiki#developer-pages) page, and in particular the [how to make your first contribution page](https://github.com/jgrapht/jgrapht/wiki/How-to-make-your-first-%28code%29-contribution). The probability that your PR gets accepted increases exponentially when your submission complies with these guidelines. Please do **not** submit PRs that are partially finished: each time you push new commits we get e-mail notifications. If you want feedback or have a dev question, please post an a message to [jgrapht-dev](https://groups.google.com/forum/#!forum/jgrapht-dev) containing a URL to your branch/repository.
jgrapht-jgrapht-1.5.2/CONTRIBUTORS.md 0000664 0000000 0000000 00000013704 14424254415 0017104 0 ustar 00root root 0000000 0000000 ## Contributors ##
Copyright Notice: The JGraphT project source code is a composite of contributions by multiple authors. The copyright for each contribution is owned by the corresponding author. For details, please see [HISTORY.md](HISTORY.md) as well as the complete git history. All authors have agreed to license their contributions to the public as open source under the specific terms noted in [README.md](README.md).
JGraphT wouldn't be the library it is today without the source contributions and suggestions made by the authors:
- [Barak Naveh](https://github.com/baraknaveh) (project founder)
- [John V Sichi](https://github.com/jsichi) (current project administrator)
- [Joris Kinable](https://github.com/jkinable) (JGraphtT Project Reviewer/Committer and Release Manager)
- [Dimitrios Michail](https://github.com/d-michail) (JGraphT Project Reviewer/Committer)
- [Timofey Chudakov](https://github.com/Toptachamann) (JGraphT Project Reviewer/Committer)
- [Semen Chudakov](https://github.com/SChudakov) (JGraphT Project Reviewer/Committer)
- [Liviu Rau](http://sourceforge.net/users/liviu_aurelian/)
- [Nathan Fiedler](http://www.bluemarsh.com/personal/index.html)
- [Michael Behrisch](http://sourceforge.net/users/behrisch/)
- [Linda Buisman](http://sourceforge.net/users/linda_buisman/)
- Erik Postma
- Mikael Hansen
- Avner Linder
- Marden Neubert
- [Christian Soltenborn](http://sourceforge.net/users/csoltenborn/)
- [Christian Hammer](http://sourceforge.net/users/hammerc/)
- Ewgenij Proschak
- [Hartmut Benz](http://sourceforge.net/users/ivins/)
- [Charles Fry](http://frogcircus.org/)
- Guillaume Boulmier
- Carl Anderson
- Khanh Vu
- Aaron Harnly
- Welson Sun
- Trevor Harmon
- David Black-Schaffer
- Vinayak Borkar
- Andrew Berman
- Lucas Scharenbroich
- Hookahey
- Tim Shearouse
- Holger Brandl
- Ilya Razenshteyn
- Peter Giles
- Andrew Newell
- Tim Engler
- Tom Larkworthy
- Soren Davidsen
- Andrea Pagani
- Tom Conerly
- Michele Mancioppi
- Adrian Marte
- [Assaf Mizrachi](https://github.com/assimiz)
- Harshal Vora
- Matt Sarjent
- Robby McKilliam
- Yuriy Nakonechnyy
- Andreas Schnaiter
- Owen Jacobson
- Alejandro R. Lopez del Huerto
- Vladimir Kostyukov
- Ernst de Ridder
- Michal Pasieka
- Alexey Kudinkin
- Adam Gouge
- Nikolay Ognyanov
- Graham Hill (AzrgExplorers)
- Leo Crawford
- Isaac Kleinman
- Sebastian Hubenschmid
- JeanYves Tinevez
- [Oliver Kopp](https://github.com/koppor)
- Javier Gutierrez (javierj)
- Nicolas Fortin
- Peter Goldstein
- Rodrigo López Dato
- Anders Wallgren
- Siarhei
- Jan Altenbernd
- Andrew Chen
- Florian Buenzli
- Thomas Tschager
- Tomas Hruz
- Philipp Hoppen
- Chris Wensel
- Wil Selwood
- Mihhail Verhovtsov
- Fabian Späh
- Rita Dobler
- [Szabolcs Besenyei](https://github.com/besza)
- Luiz Kill
- Christophe Thiebaud
- Jon Robinson
- Thomas Breitbart
- Sarah Komla-Ebri
- Graeme Ahokas
- Christoph Zauner
- [Andrew Gainer-Dewar](https://github.com/agdphd)
- Benedikt Waldvogel
- Victor Mikhaylov
- Nils Olberg
- [Daniel Gomez-Sanchez](https://github.com/magicDGS)
- [Skuratovich Sergey](https://github.com/SSNikolaevich)
- [Martin Sturm](https://github.com/WorstCase00)
- [Patrick Sharp](https://github.com/sharpTrick)
- [Piotr Turski](https://github.com/piotrturski)
- [Alexandru Văleanu](https://github.com/AlexandruValeanu)
- [Davide Cavestro](https://github.com/davidecavestro)
- [Mark Raynsford](https://github.com/io7m)
- [Mariusz Smykuła](https://github.com/mariuszs)
- [Pratik Tibrewal](https://github.com/tibrewalpratik17)
- [Chen Kui](https://github.com/Yimismi)
- [Konstantinos Karatsenidis](https://github.com/gate2k1)
- [Kirill Vishnyakov](https://github.com/LightnessOfBeing)
- [Emilio Cruciani](https://github.com/ioemilio)
- [Vivek Talreja](https://github.com/Vivek1012)
- [Gilles Gosuin](https://github.com/gilles-gosuin)
- [Viktor Volkov](https://github.com/chupacabra007)
- [Philipp Kaesgen](https://github.com/PhilippKaesgen)
- [Lukas Harzenetter](https://github.com/lharzenetter)
- [Christoph Grüne](https://github.com/christophgruene)
- [Daniel Mock](https://github.com/danielmock)
- [Oliver Feith](https://github.com/Watercrystal)
- [Abdallah Atouani](https://github.com/AbdallahAt)
- [Peter Harman](https://github.com/harmanpa)
- [Nikhil Sharma](https://github.com/nks1558)
- [Dennis Fischer](https://github.com/pdelvo)
- [PHaroZ](https://github.com/PHaroZ)
- [simlu](https://github.com/simlu)
- [Karri Sai Satish Kumar Reddy](https://github.com/ksskreddy)
- [Stephan Schroevers](https://github.com/Stephan202)
- [Ned Twigg](https://github.com/nedtwigg)
- [Karri Sai Satish Kumar Reddy](https://github.com/ksskreddy)
- [Lavish Kothari](https://github.com/LavishKothari)
- [Andre Immig](https://github.com/Aimmig)
- [Charul Bhanawat](https://github.com/CharulBhanawat13)
- [Benjamin Krogh](https://github.com/bkrogh)
- [Reynaldo Gil Pons](https://github.com/gilcu3)
- [Sean Hudson](https://github.com/shduke)
- [Edwin Ouwehand](https://github.com/EdwinOuwehand)
- [Amr Alhossary](https://github.com/aalhossary)
- [Volkov Viktor](https://github.com/bingo-soft)
- [Hannes Wellmann](https://github.com/HannesWell)
- [Shevek](https://github.com/shevek)
- [Ritik Goyal](https://github.com/rtkg12)
- [Johannes M Dieterich](https://github.com/iotamudelta)
- [Milan Szoszkiewicz](https://github.com/szoszk)
- [Baljit Singh](https://github.com/singhbaljit)
- [Sebastiano Vigna](https://github.com/vigna)
- [Florentin Dörre](https://github.com/FlorentinD)
- [Rostislav Svoboda](https://github.com/rsvoboda)
- [Dariusz Dudek](https://github.com/dpdudek)
- [Kaiichiro Ota](https://github.com/kigh-ota)
- [Magnus Gunnarsson](https://github.com/EnderCrypt)
- [Frans van Buul](https://github.com/fransvanbuul)
- [Sérgio Faria](https://github.com/sergio91pt)
- [Rene Leonhardt](https://github.com/reneleonhardt)
- [DelfinSR](https://github.com/DelfinSR)
(If we have missed your name on this list, please email us to get it fixed.)
Other people have also helped in different ways: reporting bugs, requesting features, commenting, and by merely asking very good questions.
Many thanks to all of you.
jgrapht-jgrapht-1.5.2/HISTORY.md 0000664 0000000 0000000 00000164543 14424254415 0016320 0 ustar 00root root 0000000 0000000 # HISTORY #
Changes to JGraphT in each version:
- **version 1.5.2** (2-May-2023)
- Prepared release cycle 1.5.2: removed deprecated code, updated dependencies (contributed by Joris Kinable)
- Fixed NPE when no path exists in `DijkstraManyToManyShortestPaths` (contributed by Dimitrios Michail)
- Fixed NaN exception in case of a zero displacement in `FRLayoutAlgorithm2D` (contributed by Dimitrios Michail)
- Fixed Eclipse warnings in tests (contributed by Hannes Wellmann)
- Enforced naming conventions in checkstyle, allowing Latin chars (contributed by Hannes Wellmann)
- Bug fix for `TSPLIBImporter` which failed to parse burma14 due to multi-space delimiters (reported by Joris Kinable, contributed by Hannes Wellmann)
- Fixed succinct graph constructors in outgoing-only case (contributed by Sebastiano Vigna)
- Added support for custom names in vertices/edges collections in JSON I/O (contributed by Dimitrios Michail)
- Fixed assertion message in succinct graphs (contributed by Rostislav Svoboda)
- Made result ordering predictable in some algorithms (contributed by Dimitrios Michail)
- Added user guide for WebGraph and Sux4J adapters (contributed by Sebastiano Vigna)
- Github Actions maintenance (contributed by Szabolcs Besenyei)
- Added graph specifics strategy parameter for `DirectedAcyclicGraph` (contributed by Dariusz Dudek)
- Added explicit `NotDirectedAcyclicGraphException` (contributed by Kaiichiro Ota)
- Added explicit `GraphCycleProhibitedException` (contributed by Magnus Gunnarsson)
- Support custom vertex types in `DeltaSteppingShortestPath` (contributed by Semen Chudakov)
- Added path validation to `AllDirectedPaths` (contributed by Frans van Buul)
- Added `ApBetweennessCentrality` using new dependency on apfloat library (contributed by Dimitrios Michail)
- Added `UndirectedModularityMeasurer` (contributed by Dimitrios Michail)
- Added callback API to `DirectedSimpleCycles` interface (contributed by Sérgio Faria)
- Upgraded commons-text to 1.10.0 and antlr4-runtime to 4.10.1 (contributed by Rene Leonhardt)
- Centralized dependency version declarations (contributed by Rene Leonhardt)
- Updated all dependencies pre-release (contributed by Rene Leonhardt)
- Prevented XEE in `SimpleGEXFEventDrivenImporter` (contributed by DelfinSR)
- **version 1.5.1** (18-Mar-2021)
- Prepared release cycle 1.5.1: removed deprecated code, updated dependencies (contributed by Joris Kinable)
- Fix non-determinism in `BaseKDisjointShortestPathsAlgorithm` (reported by andreamarotta, contributed by Assaf Mizrachi)
- Avoid package self-import in MANIFEST.MF (contributed by Hannes Wellmann)
- Fixes issue with reverse path weights in `DijkstraManyToManyShortestPath` (contributed by Semen Chudakov)
- Added `RescaleLayoutAlgorithm2D` - layout model rescaling algorithm (contributed by Dimitrios Michail)
- Bug fix by rewriting algorithmic part of `NaiveLCAFinder` (contributed by Timofey Chudakov)
- Added Boykov-Kolmogorov maximum flow algorithm for computer-vision related flow networks (contributed by Timofey Chudakov)
- Added `TransitNodeRoutingShortestPathAlgorithm` (contributed by Semen Chudakov)
- Added Zachary's karate club named graph (contributed by Dimitrios Michail)
- Simplified graph creation in tests (contributed by Timofey Chudakov)
- Add `RandomWalkVertexIterator`, replacing `RandomWalkIterator` (contributed by Dimitrios Michail)
- Fixed identically-positioned and isolated vertices in`FRLayoutAlgorithm2D` (reported by rlbns, contributed by Dimitrios Michail)
- Added Zhang-Shasha tree edit distance (contributed by Semen Chudakov)
- `GraphMetrics.naiveCountTriangles` now returns the correct number of triangles when multiple edges are present (reported by FlorentinD, contributed by Dimitrios Michail)
- Fixed JSON importer issue with negative integer weights (see #982) (reported by xianfuzheng, contributed by Dimitrios Michail)
- Enabled checkstyle for test files (contributed by Szabolcs Besenyei)
- Fixed hashCode/equals on weighted graphs (reported by Sebastiano Vigna, contributed by Dimitrios Michail)
- Changed hashCode/equals to ignore edge direction on undirected graphs, and made source/target assignment harmonious for EndpointPair in Guava adapter (reported by Sebastiano Vigna, contributed by Dimitrios Michail)
- Bring back importer support for supplying attributes at the point where vertex/edge instantiation occurs (reported by Sebastian Goeb, contributed by Dimitrios Michail)
- Added `GraphIterables` interface extension for big graph support (suggested by Sebastiano Vigna, contributed by Dimitrios Michail)
- Fixed label propagation clustering bug with isolated vertices (contributed by Dimitrios Michail)
- Added Bipartite layout drawing algorithm (contributed by Dimitrios Michail)
- Fixed addEdge in `AbstractGraphBuilder` (contributed by Baljit Singh)
- Added code of conduct (contributed by John Sichi)
- Added documentation for graph thread safety and updated graph equality (contributed by John Sichi)
- Enhanced and refactored AlphaCentrality to Katz- and Eigenvector-Centrality (contributed by Sebastiano Vigna)
- Added overflow strategy in `BetweennessCentrality` (contributed by Dimitrios Michail)
- Replaced `VertexDegreeComparator` and `GeneralVertexDegreeComparator` objects with lambda (contributed by Hannes Wellmann)
- Improved performance of the weighted `PageRank` algorithm by caching graph adjacency lists (contributed by Florentin Dörre)
- Optimized integer to vertex mappings in several algorithms (contributed by Hannes Wellmann)
- Added a collection of local algorithms for link prediction (contributed by Dimitrios Michail)
- Fixed some linty Integer comparisons (contributed by Dimitrios Michail)
- Added `ThreadPoolExecutor` parameter to all parallel algorithms (contributed by Semen Chudakov)
- Fixed bug in `DeltaSteppingShortestPath` (see #994) (reported by Andreas Hartung, contributed by Semen Chudakov)
- Added NETGEN-style problems generator (contributed by Timofey Chudakov)
- Added algorithm for minimum cycle mean (contributed by Semen Chudakov)
- Replace Travis CI with Github Actions (contributed by Szabolcs Besenyei)
- Added WebGraph adapter (contributed by Sebastiano Vigna with assistance from Dimitrios Michail)
- Added support for vertex provider with attributes in `JSONImporter` (contributed by Dimitrios Michail)
- Added edge betweenness centrality algorithm (contributed by Dimitrios Michail)
- Added Girvan-Newman community detection algorithm (contributed by Dimitrios Michail)
- Refactored sparse graphs to allow different backend implementations (contributed by Dimitrios Michail)
- Improved `SupplierUtil` and added tests (contributed by Hannes Wellmann)
- Added succinct graph implementations using sux4j (contributed by Sebastiano Vigna)
- Ensured predictable vertex order in `MaximumCardinalityIterator` (contributed by Dimitrios Michail)
- Used -noimport to simplify package self-import exclusion (contributed by Hannes Wellmann)
- Reduced intrusive edge map lookups and prevented invalid reuse (contributed by Hannes Wellmann)
- Moved exceptions to be public at top level (contributed by Hannes Wellmann)
- Improvements to Hamiltonian Cycle algorithms (contributed by Hannes Wellmann)
- Improvements to strong connectivity algorithms (contributed by Hannes Wellmann)
- **version 1.5.0** (14-Jun-2020)
- Prepared release cycle 1.4.1: removed deprecated code, updated dependencies, upgraded java to version 11 (contributed by Joris Kinable)
- Bring back vertex factory in importers (contributed by Dimitrios Michail)
- Added `LabelPropagationClustering` algorithm (contributed by Dimitrios Michail)
- Make sure `addVertex()` fires listener event (spotted by akirschbaum, contributed by Dimitrios Michail)
- Change queue implementation from LinkedList to ArrayDeque (spotted by shevek, contributed by Ritik Goyal)
- Added TSPLIB95 graph and tour importer (contributed by Hannes Wellmann)
- Fixed issue with inconsistent graph after duplicate edge addition (spotted by Greg Gibeling, contributed by Dimitrios Michail)
- Fixed issue with failing `DirectedScaleFreeGraphGenerator` by fixing the tests seed (contributed by Timofey Chudakov)
- Fixed corner case issue with `BoyerMyrvoldPlanarityInspector` (spotted by Malcolm Deck, contributed by Timofey Chudakov)
- Added tree dynamic connectivity using the Euler tour data structure (contributed by Timofey Chudakov)
- `GmlExporter` support for custom attributes (contributed by Dimitrios Michail)
- Invoking `addVertex()` on an `AsUnmodifiableGraph` now throws an `UnsupportedOperationException` (contributed by Dimitrios Michail)
- Added `PathValidator` functionality to `YenKShortestPath` (contributed by Semen Chudakov)
- Optimize debugging in VF2 (contributed by Johannes M Dieterich)
- Fix calculation of matching weight in `MaximumWeightBipartiteMatching` (contributed by Dimitrios Michail)
- Add GEXF import/export (contributed by Dimitrios Michail)
- Change cache array entries from Boolean to byte in `GraphOrdering` (contributed by Johannes M Dieterich)
- Cache edge references in `GraphOrdering` (contributed by Johannes M Dieterich)
- Fix to make JSON import/export symmetric (contributed by Dimitrios Michail)
- Added support for exporting identifiers in DotExporter (contributed by Milan Szoszkiewicz)
- Fixed cycle order in `HawickJamesSimpleCycles` (contributed by Dimitrios Michail)
- Fixed unreported edge attributes in `SimpleGraphMLImporter` (contributed by Dimitrios Michail)
- Optimized `isFeasiblePair` and finalized fields (contributed by Johannes M Dieterich)
- Unified TSP algorithms internal implementation (contributed by Hannes Wellmann)
- Deprecated `KShortestSimplePaths` due to bug reported in #892 (contributed by Semen Chudakov)
- Clean up some docs and tests (contributed by Oliver Kopp)
- Add .editorconfig (contributed by Oliver Kopp)
- Change assert to mandatory enforcement in `AsWeightedGraph` (contributed by Dimitrios Michail)
- Streamline constructors in `VertexToIntegerMapping` (contributed by Hannes Wellmann)
- Add explicit module definitions (contributed by Dimitrios Michail)
- Enforce warnings (contributed by John Sichi after nudge from Oliver Kopp)
- Prevent tabs in XML files (contributed by John Sichi)
- **version 1.4.0** (21-Feb-2020):
- Prepared release cycle 1.3.2: removed deprecated code, updated dependencies, etc (contributed by Joris Kinable)
- Format code in parallel (contributed by Joris Kinable)
- Fix edge reuse bug in KDisjointShortestPaths implementations (contributed by Benjamin Krogh)
- Updated Yen's algorithm to operate on pseudo graphs correctly (contributed by Semen Chudakov)
- Updated Guava to version 28.0 (contributed by John Sichi)
- Fixed bug in `BiconnectivityInspector` which would occasionally return an incorrect set of biconnected components (contributed by Reynaldo Gil Pons)
- Allow edge selection to be overridden in `CrossComponentIterator` (contributed by Sean Hudson)
- Reuse traversal listener implementation in tests (contributed by Timofey Chudakov)
- Fixed bug in `BetweennessCentrality` which occasionally returned in incorrect centrality score for vertices in weighted graphs (contributed by Gil Pons)
- Added path length limit to `HawickJamesSimpleCycles` (contributed by Edwin Ouwehand)
- Added links in Guava adapater package-info (contributed by John Sichi)
- Added Boyer-Myrvold planarity testing algorithm (contributed by Timofey Chudakov)
- Added contraction hierarchy precomputation algorithm (contributed by Semen Chudakov)
- Enhanced `IntegerComponentNameProvider` to take arbitrary base (contributed by Amr Alhossary)
- Fixed a bug in the `GraphWalk.equals()` method which caused a NullpointerException when invoked on an empty walk (contributed by Volkov Viktor)
- Added k-spanning-tree clustering algorithm (contributed by Dimitrios Michail)
- Added directed scale-free graph generator (contributed by Amr Alhossary)
- Enhanced `CompleteGraphGenerator` and `CompleteBipartiteGraphGenerator` to generate edges between existing vertices (contributed by Joris Kinable)
- Added efficient bidirectional Dijkstra implementation based on contraction hierarchy (contributed by Semen Chudakov)
- Added sparse graphs and event-based importers, and improved numerous algorithms (contributed by Dimitrios Michail)
- Added `CollectionUtil` for preallocating maps and sets correctly (contributed by Hannes Wellmann)
- Added efficient many-to-many shortest path algorithm based on contraction hierarchy (contributed by Semen Chudakov)
- Added greedy, nearest-insertion, nearest-neighbor heuristic for TSP and improved stability in two-opt heuristic (contributed by Peter Harman)
- Enhanced `DoublyLinkedList` by implementing the `List` and `Deque` interfaces (contributed by Hannes Wellmann)
- Added dedicated class for `ContractionHierarchy` (contributed by Semen Chudakov)
- Use try with resources in default implementations of GraphImporter and GraphExporter (contributed by Hannes Wellmann)
- Fixed naive lca bug and code cleanup (reported by Shinpei Hayashi, contributed by Timofey Chudakov)
- Enhanced Javadoc generation by adding compatibility with newer JDKs (contributed by Dimitrios Michail)
- Reflection speedup (suggested by shevek, contributed by Dimitrios Michail)
- Added a graph drawing component, including various layout algorithms incl., random, circular, and tree layouts, the Fruchterman and Reingold Force-Directed Placement algorithm, and a variation of the latter augmented with the Barnes-Hut indexing technique (contributed by Dimitrios Michail)
- **version 1.3.1** (3-Jun-2019):
- Prepared release cycle 1.3.1: removed deprecated code, updated dependencies, etc (contributed by Joris Kinable)
- Added new logo (from 99designs, with site additions by John Sichi and Joris Kinable)
- Added new website (contributed by John Sichi)
- Converted all methods and fields to protected in `HierholzerEulerianCycle` (contributed by simlu)
- Optimized specifics hash lookups (contributed by Dimitrios Michail)
- Fixed mobile website menu (contributed by Karri Sai Satish Kumar Reddy)
- Upgraded Antlr version to 4.7.2 and jheaps to 0.10 (contributed by Dimitrios Michail)
- Replaced URL with URI in HelloJGraphT example (contributed by Stephan Schroevers)
- Deprecated `FibonacciHeap` (contributed by Timofey Chudakov)
- Replaced usage of `Graph.{vertex,edge}Set().contains()` by `Graph.contains{Vertex,Edge}()` (contributed by Ned Twigg)
- Updated examples with Guava adapter example (contributed by John Sichi)
- Added Warnsdorff rule heuristic and Parberry's algorithm for closed knight's tour problem to demo package (contributed by Kirill Vishnyakov)
- Added min weight, max weight and max weight perfect matching algorithms (contributed by Timofey Chudakov)
- Fixed bug where DOTImporter throws NullPointerException when trying to parse a vertex without attributes (contributed by Dimitrios Michail)
- Added BFS as a shortest path algorithm (contributed by Karri Sai Satish Kumar Reddy)
- Added concurrent implementation of the delta-stepping shortest path algorithm (contributed by Semen Chudakov)
- Added support for the capacitated minimum spanning tree (CMST) problem (contributed by Christoph Grüne)
- Made `GraphMLImporter` ordering deterministic (contributed by Dimitrios Michail)
- Added bidirectional A-star (contributed by Semen Chudakov)
- Added Yen's k shortest loopless paths algorithm (contributed by Semen Chudakov)
- Defer graph vertex iterator initialization in CrossComponentIterator (contributed by John Sichi)
- Updated jgraphx version to 3.9.8.1 (contributed by John Sichi)
- Added JSON exporter and importer (contributed by Dimitrios Michail)
- Enhanced `DirectedAcyclicGraph` to support multiple edges (contributed by Dimitrios Michail based on a suggestion by Sarat Chandra Balla)
- Refactored `SerializationTestUtils` and made it generic (contributed by Lavish Kothari)
- Added more serialization test coverage (contributed by Lavish Kothari)
- Added Goldberg's algorithms for the calculation of maximum density subgraphs (contributed by Andre Immig)
- Optimize UnmodifiableUnionSet to lazily read live sizes from underlying sets (contributed by John Sichi)
- Added Eppsteins k-shortest paths algorithm (contributed by Semen Chudakov)
- Added serialization test for `AsGraphUnion` and made `WeightCombiner` default implementations serializable (contributed by Charul Bhanawat)
- **version 1.3.0** (12-Nov-2018):
- Prepared release cycle 1.2.1: removed deprecated code, updated dependencies, etc (contributed by Joris Kinable)
- Restored optional tests for `BergeGraphInspector` (contributed by Philipp Kaesgen)
- Use POSIX tar format for assembly (contributed by Mark Raynsford)
- Moved BrownBacktrackingColoring out of experimental, fixed bugs and wrote tests (contributed by Joris Kinable)
- Removed code not dual licensed under EPL-1.0 and LGPL-2.1-or-later: `AsUnweightedGraph` and `AsWeightedGraph` are gone. (supported by Robert Höttger and Oliver Kopp)
- Added forest generator based on the Barabasi-Albert model (contributed by Alexandru Văleanu)
- Added new implementation of `AsUnweightedGraph` and `AsWeightedGraph` (contributed by Lukas Harzenetter)
- Added pull request template (contributed by Oliver Kopp)
- Added `GraphSpecificsStrategy` and use the same edge set factory consistently (contributed by Dimitrios Michail)
- Added user overview doc (contributed by John Sichi)
- Clarified definition of `SimpleGraph` (contributed by Joris Kinable)
- Added O(m^1.5) algorithm for counting triangles in undirected graphs (contributed by Alexandru Văleanu)
- Calculate actual path weight in `AllDirectedPaths` (contributed by Andrew Gainer-Dewar)
- Refactored vertex cover tests (contributed by Alexandru Văleanu)
- Added `SimpleGraphMLImporter` for faster parsing (contributed by Dimitrios Michail)
- Increased numeric precision in PushRelabelMFImpl (contributed by Alexandru Văleanu)
- Added ColorRefinement and ColorRefinementIsomorphismInspector (contributed by Christoph Grüne, Daniel Mock, Oliver Feith and Abdallah Atouani)
- Improved efficiency of `BhandariKDisjointShortestPaths` (contributed by Assaf Mizrachi)
- Added `UnmodifiableUnionSet` to optimize `AsGraphUnion` (contributed by Dimitrios Michail)
- Made `GraphWalk` serializable (contributed by Alexandru Văleanu)
- Optimize `JohnsonShortestPaths` space usage (contributed by Dimitrios Michail)
- Heuristics for `FloydWarshallShortestPaths` (suggested by shevek, contributed by Dimitrios Michail)
- Added new `TreeToPathDecompositionAlgorithm` interface and implementation `HeavyPathDecomposition` (contributed by Alexandru Văleanu)
- Removed recursion from `FibonacciHeap` (contributed by Timofey Chudakov)
- Added `PruferTreeGenerator` for generating trees based on Prüfer sequences (contributed by Alexandru Văleanu)
- Added `VertexToIntegerMapping` utility class (contributed by Alexandru Văleanu)
- Handle maxLength=0 case in AllDirectedPaths (reported by Nikolas Havrikov, contributed by Andrew Gainer-Dewar)
- Added `SuurballeKDisjointShortestPaths` (contributed by Assaf Mizrachi)
- Make AsWeightedGraph propagate weight changes by default when backing graph is weighted (contributed by John Sichi)
- Fix assumptions about SAX `characters()` method calls in GraphML importers (contributed by Dimitrios Michail)
- Throw exception from no-arg `addVertex` when duplicate vertex generated (contributed by Dimitrios Michail)
- Replace `GenericFibonacciHeap` with dependency on jheaps library (contributed by Dimitrios Michail)
- Added `DulmageMendelsohnDecomposition` (contributed by Peter Harman)
- Package one bundle jar instead of multiple uber jars (contributed by Dimitrios Michail)
- Removed touchgraph support and corresponding module jgrapht-touchgraph (contributed by John Sichi)
- Added `ClusteringCoefficient` to compute the local and global clustering coefficient of a graph (contributed by Alexandru Văleanu)
- Refactored LCA interface, reimplemented Tarjan's algorithm and added HeavyPathLCAFinder, BinaryLiftingLCAFinder, EulerTourRMQLCAFinder (contributed by Alexandru Văleanu)
- Added jgrapht-opt module with fastutil graph implementation (contributed by Dimitrios Michail)
- Added negative weight cycle reporting in Bellman-Ford (contributed by Dimitrios Michail in response to proposal from Miron Balcerzak)
- Added `KolmogorovMinimumWeightPerfectMatching` (contributed by Timofey Chudakov)
- Added graph implementation specific for integer vertices and fastutil map to jgrapht-opt module (contributed by Dimitrios Michail)
- Added Christofides algorithm for computing 3/2 approximate TSP solutions (contributed by Timofey Chudakov)
- Fixed bug in HeldKarpTSP (reported by Timofey Chudako, contributed by Alexandru Văleanu)
- Addded `PartitioningAlgorithm` interface and `BipartitePartitioning` implementation for recognizing bipartite graphs (contributed by Alexandru Văleanu)
- Fixed bug in `GraphTests.isStronglyConnected`: undirected graphs are now correctly identified as strongly connected whenever the graph is connected (reported by Joris Kinable, contributed by Dimitrios Michail)
- Upgraded EPL to v2.0, copyright header cleanup, removed @since tag (contributed by John Sichi)
- Use checkstyle to enforce correct file headers (contributed by John Sichi)
- Added `ChinesePostman` (contributed by Joris Kinable)
- Added `LineGraphConverter` (contributed by Joris Kinable and Nikhil Sharma)
- Refactoring for color refinement (contributed by Dimitrios Michail)
- Added implementation for minimum cost flow problems through the Successive Shortest Path algorithm with capacity scaling (contributed by Timofey Chudakov)
- Updated library dependencies (contributed by Joris Kinable)
- Added exporter for the Lemon (LGF) format (contributed by Dimitrios Michail)
- Added support for using an edge function in AsWeightedGraph (contributed by Joris Kinable)
- Fixed bug in ColorRefinementIsomorphismInspector which required a disjoint graph union (contributed by Christoph Grüne and Dennis Fischer)
- Bug fix in the Watts-Strogatz generator which caused a null pointer exception when the graph vertices were any type except integers (contributed by Dimitrios Michail)
- Added support for edge weights in CSV export/import (contributed by Dimitrios Michail)
- Added support for html attributes and labels in DOTExporter (contributed by PHaroZ)
- Unified flow interfaces (contributed by Joris Kinable)
- Optimizations for Edmonds maximum cardinality matchings (contributed by Dimitrios Michail)
- **version 1.2.0** (16-May-2018):
- Prepared release cycle 1.1.1: removed deprecated code, updated dependencies, etc (contributed by Joris Kinable)
- Updated demos (contributed by Dimitrios Michail)
- Added assertions to NeighborCache (contributed by Joris Kinable)
- Upgraded Antlr version to 4.7 (contributed by Dimitrios Michail)
- Rewrote `MaximumWeightBipartiteMatching` with exact arithmetic, introducing a `GenericFibonacciHeap` (contributed by Dimitrios Michail)
- Updated jmh to jdk9 compatible version; updated xmlunit to 2.x (contributed by Dimitrios Michail)
- Fixed FastLookup specifics to init edge container capacity to 1 (suggested by shevek, contributed by Joris Kinable)
- Made `IntrusiveEdgesSpecifics` interface public and optimized add call sequence (suggested by shevek, contributed by Dimitrios Michail)
- Fixed deprecation of Class.newInstance for Java 9; cleaned up GraphTests (contributed by Dimitrios Michail)
- Fixed PathValidator interface to use GraphPath (contributed by Assaf Mizrachi)
- Added Held-Karp dynamic programming algorithm for TSP (contributed by Alexandru Văleanu)
- Added fundamental cycle basis implementations (contributed by Dimitrios Michail)
- Added `BetweennessCentrality` scoring algorithm (contributed by Assaf Mizrachi)
- Automatically publish snapshots after successful Travis CI builds (contributed by Davide Cavestro)
- Implemented method findLcas() in NaiveLcaFinder (contributed by Alexandru Văleanu)
- Added `MultiObjectiveShortestPathAlgorithm` interface and first implementation `MartinShortestPath` (contributed by Dimitrios Michail)
- Added `TwoOptHeuristicTSP` (contributed by Dimitrios Michail)
- Fixed bug in `JohnsonSimpleCycles` with custom edge type (spotted by fredshevek, fix contributed by Dimitrios Michail)
- Added Automatic-Module Names to the various jgrapht modules to support modularization in JDK 9 (contributed by Mark Raynsford)
- Added `GraphTypeBuilder` (contributed by Dimitrios Michail)
- Reimplemented BiconnectivityInspector with additional functionality such as computing bridges and articulation points. BiconnectivityInspector now works on multiple graph types (contributed by Joris Kinable)
- Revised BlockCutpointGraph and added additional tests (contributed by Joris Kinable)
- Removed old JUnit 3 dependencies (contributed by Joris Kinable)
- Fixed bug with maxPathLength equal to 1 in AllDirectedPaths (contributed by Andrew Gainer-Dewar)
- Allow digits as non-leading character in DOTUtils#isValidID (contributed by Mariusz Smykuła)
- Escape quotes in identifiers in `DOTExporter` (contributed by Mariusz Smykuła)
- Added `AlphaCentrality` (contributed by Pratik Tibrewal)
- Fixed bug in AbstractBaseGraph where degreeOf() method would create vertex instead of throwing an exception (spotted and fixed by Chen Kui)
- Added Folkman, Diamond, Tietze, Pappus and Tutte named graphs (contributed by Pratik Tibrewal)
- Added automorphism count verification to NamedGraphGeneratorTest (contributed by Pratik Tibrewal)
- Removed old JGraph dependency, updated JGraphX to version 3.4.1.3, minor revision of `JGraphXAdapterDemo` (contributed by John Sichi)
- Added `ChordalityInspector`, `LexBreadthFirstIterator`, and `MaximumCardinalityIterator` (contributed by Timofey Chudakov)
- Removed redundant parameter from `TypeUtil.uncheckedCast` method (contributed by Konstantinos Karatsenidis)
- Removed recursion from `NaiveLcaFinder.findLca` method (contributed by Konstantinos Karatsenidis)
- Added `AsSynchronizedGraph` in new package `org.jgrapht.graph.concurrent` (contributed by Chen Kui)
- Fixed bug with `ClosestFirstIterator` when given multiple start vertices (repro by shevek, fixed by John Sichi)
- Added method `GraphMeasurer.getGraphPseudoPeriphery` to compute the Pseudo-Periphery of a graph (contributed by Alexandru Văleanu)
- Added `PalmerHamiltonianCycle` which implements Palmer's exact algorithm to find Hamiltonian Cycles in undirected graphs. Added new interface `HamiltonianCycleAlgorithm`. (contributed by Alexandru Văleanu)
- Removed lazy instantiation of containers in edge specifics (contributed by Dimitrios Michail)
- Added `DinicMFImpl` which implements Dinic's maximum flow algorithm (contributed by Kirill Vishnyakov)
- Optimized `PushRelabelMFImpl` implementation which drastically improves max flow computations on certain graphs. (contributed by Alexandru Văleanu)
- Added `RandomRegularGraphGenerator` (contributed by Emilio Cruciani)
- Reimplemented significantly faster version of Prim's minimum spanning tree algorithm using a FibonacciHeap (suggested by Joris Kinable, contributed by Alexandru Văleanu)
- Added new jgrapht-guava module containing adapters for package com.google.common.graph (contributed by Dimitrios Michail)
- Demo classes listed on our wiki page are now also included in our demo package (contributed by Vivek Talreja)
- Added missing math markup to javadoc in all classes (contributed by Kirill Vishnyakov)
- Expose lock as public for `AsSynchronizedGraph`, and add copyless access mode (contributed by John Sichi)
- Handle nested structures in `GmlImporter` (suggested by Philippe Marchesseault, contributed by Dimitrios Michail)
- Replaced StringBuffer with StringBuilder (contributed by John Sichi)
- Added search tree query methods to `BreadthFirstIterator` (contributed by Joris Kinable)
- Improved documentation of VF2 subgraph isomorphism algorithm (contributed by John Sichi)
- Removed recursion from DAG forward and backwards DFS methods (contributed by Gilles Gosuin)
- Implemented performance improvements for `GnmRandomGraphGenerator` and `GnpRandomGraphGenerator` (suggested by @Shevek, contributed by Dimitrios Michail)
- Added `WeakChordalityInspector` to test whether a graph is weakly chordal (contributed by Timofey Chudakov)
- Fixed typo in `TreeSingleSourcePathsImpl` (contributed by Viktor Volkov)
- Deprecated `EdgeFactory` in favor of `Supplier`, and added supplier support for vertices as well (contributed by Dimitrios Michail)
- Separate fast and slow tests, via mvn test vs verify (contributed by Dimitrios Michail)
- Added `ChordalGraphMinimalVertexSeparatorFinder` for the detection of minimal vertex separators in chordal graphs (contributed by Timofey Chudakov)
- Added suites for fast tests, integration tests and performance tests (contributed by John Sichi)
- Refactored `ChordalityInspector` and revised several interfaces (vertex cover, independent set, clique, etc) (contributed by Joris Kinable)
- Minor improvements to `DOTExporter` (contributed by Dimitrios Michail)
- Added graph listener event for edge weight update (contributed by Dimitrios Michail)
- Added Planted Partition Graph Generator `PlantedPartitionGraphGenerator` (contributed by Emilio Cruciani)
- Added `BergeGraphInspector` which checks whether a graph is perfect (contributed by Philipp Kaesgen)
- Added Bhandari K-disjoint shortest paths implementation `BhandariKDisjointShortestPaths` (contributed by Assaf Mizrachi)
- **version 1.1.0** (13-Nov-2017):
- Added ID descriptor to maven-assembly-plugin configuration to prevent a 'Assembly is incorrectly configured' error being thrown (contributed by Joris Kinable)
- Deleted all previously deprecated methods and general cleanup (contributed by Joris Kinable)
- Moved all importers/exporters from org.jgrapht.ext to org.jgrapht.io. This change allows users to use importers/exporters without the dependency on the various visualization libraries. (contributed by Dimitrios Michail)
- Added vertex coloring interface `VertexColoringAlgorithm`, as well as several greedy graph coloring algorithms (`LargestDegreeFirstColoring`, `RandomGreedyColoring`, `SaturationDegreeColoring`, `SmallestDegreeLastColoring`). The former `ChromaticNumber` class is now deprecated, as well as some related classes in the experimental package. (contributed by Dimitrios Michail)
- Extended the network analysis algorithms by adding closeness centrality computation (contributed by Dimitrios Michail)
- Added interface `StrongConnectivityAlgorithm`; Extracted common code of strong connectivity inspectors to abstract base class; added method which computes the graph condensation. (contributed by Dimitrios Michail)
- Added interface `TSPAlgorithm`, Added 2-approximation algorithm for metric TSP `TwoApproxMetricTSP`. The old implementation `HamiltonianCycle` is now deprecated due to its reduced efficiency. (contributed by Dimitrios Michail)
- Added a new, scalable `DOTImporter` which handles the full DOT specification including XML string identifiers. A dependency on the commons-lang3 package has been added to handle escaping/unescaping of strings efficiently; Updated antlr version to 4.6. (contributed by Dimitrios Michail)
- Added Johnson's all-pairs-shortest paths algorithm `JohnsonShortestPaths`; Simplified Bellman-Ford implementation and added support for negative cycle detection; added `AsWeightedUndirectedGraph` and `AsUnweightedUndirectedGraph`; Constructors of `UndirectedGraphUnion` are now public. (contributed by Dimitrios Michail)
- Refactored `DirectedAcyclicGraph`, moved it out of the experimental package, and refactored its perfomance tests using jmh; Deleted `GraphSquare` from experimental (inefficient implementation) (contributed by Dimitrios Michail)
- Added Watts-Strogatz small-world graph generator, Kleinberg's small-world graph generator, Barabasi-Albert graph generator, Linearized Chord Diagram GraphGenerator, AliasMethodSampler utility class with Vose's implementation; Refactored ScaleFreeGraphGenerator (constructor with random number generator added); Refactored CompleteGraphGenerator to not assume a specific graph type (simple, etc). (contributed by Dimitrios Michail)
- Deleted JUnit test suites. (contributed by Joris Kinable)
- Added interface `MaximalCliqueEnumerationAlgorithm`; Refactored and added timeout in BronKerbosch clique enumeration; Added pivot variant of Bron-Kerbosch; Added Bron-Kerbosch variant with pivoting and degeneracy ordering; Added Coreness vertex scorer; Added Degeneracy graph iterator; Added performance test for maximal clique enumeration algorithms (contributed by Dimitrios Michail)
- Deprecated `DirectedGraph`, `UndirectedGraph`, and `WeightedGraph`, moving their methods up to the base `Graph` interface; added `GraphType` metadata; made usage of DefaultWeightedEdge optional for weighted graphs (contributed by Dimitrios Michail)
- Refactored traversal iterators (contributed by Dimitrios Michail)
- Backport to support build using Android SDK 24 (contributed by Dimitrios Michail)
- Added support for attributes in GmlImporter; extracted common code from importers and exporters into abstract base classes to avoid code duplication. (contributed by Dimitrios Michail)
- Fixed issue where HierholzerEulerianCycle would sometimes set the wrong startVertex (reported by Frank Gevaerts, contributed by Dimitrios Michail)
- Revised `GraphWalk`; added additional input checks, additional functionality such as reverse and concat, added verification and factory methods. (contributed by Joris Kinable)
- Made several algorithm return objects iterable. (contributed by Joris Kinable)
- Support latex math notation in Javadoc (contributed by Joris Kinable)
- Allow CrossComponentIterator to start from a collection of startVertices (contributed by Patrick Sharp)
- New implementation of Edmonds' maximum cardinality matching algorithm for general graphs. Added certifier for maximum cardinality by computing a Edmonds-Gallai decomposition. Reimplemented Hopcroft-Karp's algorithm for bipartite graphs. Added greedy algorithm for maximum cardinality case and enhanced greedy algorithm for the weighted case. Extended UnionFind with additional functionality. (contributed by Joris Kinable)
- Optimize map operations in FastLookupSpecifics (suggested by shevek, fix contributed by Joris Kinable)
- Added importers and exporters for the graph6 (g6) and sparse6(s6) graph format (contributed by Joris Kinable)
- Added graph generator for Generalized Petersen graphs (contributed by Joris Kinable)
- Added graph generator for Windmill, Dutch Windmill and Friendship graphs (contributed by Joris Kinable)
- Added collection of 31 commonly used named graphs (contributed by Joris Kinable)
- Added GraphMeasurer class to compute graph diameter, radius, vertex eccentricity, graph center and graph periphery (contributed by Joris Kinable)
- Added GraphMetrics which computes general graph metrics; added method to compute the girth of a graph (contributed by Joris Kinable)
- Added GraphTests: isCubic, isOverfull, isForest, isSplit (contributed by Joris Kinable)
- Added basic support for graph attributes in DOTExporter (contributed by Dimitrios Michail)
- Added a generator which generates the complement graph of a given input graph (contributed by Joris Kinable)
- Performance improvement for Johnson's algorithm when a directed graph has no negative edge weights (contributed by Joris Kinable)
- Fix `BellmanFordShortestPath` to return null instead of empty path (contributed by Dimitrios Michail)
- Added type information in attributes for graph importers/exporters (contributed by Dimitrios Michail, per suggestion from Dimitrij Drus)
- Changed `UnionFind` from recursive to iterative (contributed by Piotr Turski)
- New `NeighborCache` replaces both `NeighborIndex` and `DirectedNeighborIndex`; this new class supports both directed and undirected graphs (contributed by Szabolcs Besenyei)
- Fixed bug in `PushRelabelMFImpl`: passing an object as parameter to `calculateMaxFlow` which is equal but not identical to the corresponding node in the graph would cause a Nullpointer exception.
- **version 1.0.1** (16-Jan-2017):
- Deleted all previously deprecated methods (cleanup contributed by Joris Kinable and Dimitrios Michail)
- Cleanup of main pom.xml; Added `CONTRIBUTING.md` (contributed by John Sichi)
- Added Checkstyle plugin and rules; they are automatically executed by Travis (contributed by Dimitrios Michail)
- Unified graph export name providers using a common interface (contributed by Dimitrios Michail)
- Fix `GnmRandomGraphGenerator` bug in computation of maximum number of edges (contributed by Dimitrios Michail)
- Added new demo class `GraphMLDemo` to demonstrate importing and exporting graphs in the GraphML format (contributed by Dimitrios Michail)
- Added project badges (contributed by Daniel Gómez-Sánchez)
- Hide autogenerated classes of antlr (contributed by Dimitrios Michail)
- DOT-language import/export changes (contributed by Daniel Gómez-Sánchez)
- Clean up tests and warnings (contributed by Dimitrios Michail)
- Fixed GraphML importer xsd resolution bug (contributed by Dimitrios Michail, spotted by Peter Manning Jr.)
- Replaced VertexPair/UnorderedVertexPair with Pair/UnorderedPair (contributed by Dimitrios Michail)
- Clean up AbstractBaseGraph/Specifics dependencies (contributed by Dimitrios Michail)
- `GraphTests` has been reworked, extended with additional functionality, and moved from experimental to the core package (contributed by Dimitrios Michail and Barak Naveh)
- a `IntegerVertexFactory` has been added to the test package to reduce code duplication (contributed by Dimitrios Michail)
- 2 new 1/2-approximation algorithms (greedy algorithm and Drake and Hougardy path growing algorithm) have been added; matching algorithms have been moved to dedicated package (contributed by Dimitrios Michail)
- Added `HierholzerEulerianCycle`, a Linear time implementation of Hierholzer's algorithm to find a Eulerian Circuit in the graph. This class replaces the old `EulerianCircuit` implementation since it is significantly faster. (contributed by Dimitrios Michail)
- Added methods for adding/deletion of specified edge in graph builders (contributed by Skuratovich Sergey)
- Fixed a NullPointerException caused by `GraphMLImport` when an attributed was associated with the graph itself (i.e. at the level); this could occur for instance with yED graphml instances. (reported by Tim Schultze, contributed by Dimitrios Michail)
- Minor updates and fixes to demo (contributed by Dimitrios Michail)
- Removed underscore identifiers and refactored tests in `KuhnMunkresMinimalWeightBipartitePerfectMatchingTest`. (contributed by Szabolcs Besenyei)
- All matching algorithms are now unified under a new `MatchingAlgorithm` interface; the old `WeightedMatchingAlgorithm` interface is now deprecated. (contributed by Dimitrios Michail)
- Added Borůvka's algorithm for the computation of a minimum spanning tree (contributed by Dimitrios Michail)
- Revised spanning tree and spanner interfaces and bundled them under the alg.spanning package (contributed by Dimitrios Michail)
- Small improvements in `StopWatch` class (contributed by Dimitrios Michail)
- Revised `Subgraph`, `MaskSubgraph` and subclasses to use Java 8 features; incorporated a number of performance improvements. Revised `MaskSubgraph` uses Java 8 predicates instead of the `MaskFunctor` interface. The latter interface is now deprecated. (contributed by Dimitrios Michail)
- Added `GusfieldGomoryHuCutTree`, `GusfieldEquivalentFlowTree`, and `PadbergRaoOddMinimumCutset` (contributed by Joris Kinable, following up on a Gomory-Hu proposal from Mads Jensen)
- Added support for inconsistent admissible heuristics in A* search (contributed by Joris Kinable)
- Added a `DIMACSExporter` which supports exporting graphs in various DIMACS formats (contributed by Dimitrios Michail)
- Enforce valid nodes in `FibonacciHeap`; Fixed a bug which could cause an infinite loop in the Fibonacci heap consolidate() method. (contributed by Dimitrios Michail)
- Revision of shortest path algorithms. Added interfaces `ShortestPathAlgorithm` and `KShortestPathAlgorithm`, and bundled shortest path algorithms in dedicated package. Adjusted KShortestPaths returns an empty list instead of null if no path exists. (contributed by Dimitrios Michail)
- `FlowdWarshall` now has support for multigraphs. Fixed diameter method now returns POSITIVE_INFINITY when a graph is disconnected. (contributed by Dimitrios Michail)
- `GraphPath` supports zero edge paths (path consisting of 1 vertex). (contributed by Dimitrios Michail)
- `DijkstraShortestPath` as well as several other shortest path classes can now return single-source shortest paths, using the traditional representation of a shortest path tree (contributed by Dimitrios Michail)
- Added an implementation of Goldberg and Harrelson's ALT admissible heuristic for A* (contributed by Dimitrios Michail)
- Replaced the `ClosestFirstIterator` in `DijkstraShortestPath` by a light-weight version of the iterator which significantly speeds up the shortest path computations. (contributed by Dimitrios Michail)
- Added implementation of Larry Page's `PageRank` algorithm. (contributed by Dimitrios Michail)
- Added faster transitive closure calculation for DAGs. (contributed by Martin Sturm)
- K-shortest paths interface now accepts k as a parameter (contributed by Dimitrios Michail)
- **version 1.0.0** (19-Sept-2016):
- Moved to JDK 1.8 (cleanup contributed by Joris Kinable)
- Fixes for `MaskSubgraph`, contributed by Andrew Gainer-Dewar
- Optimized edge lookups (contributed by Joris Kinable)
- Use LinkedHashSet in `CycleDetector` (contributed by Benedikt Waldvogel)
- Use unique OSGi bundle symbolic name for uber artifact (contributed by Christoph Zauner)
- Replace experimental GraphReader with `DIMACSImporter` (contributed by Joris Kinable)
- Implement various graph utility methods (contributed by Christoph Zauner)
- Add getFirstHop and getLastHop to `FloydWarshallShortestPaths` (contributed by Joris Kinable)
- Allow paths to be expressed in terms of vertices instead of edges; deprecate `GraphPathImpl` in favor of new `GraphWalk` (contributed by Joris Kinable)
- Weighted graph support in `GmlExporter` (contributed by Dimitrios Michail)
- Add `RandomWalkIterator` (contributed by Assaf Mizrachi)
- Add `GreedyMultiplicativeSpanner` (contributed by Dimitrios Michail)
- Support undirected graphs in max flow algorithms (contributed by Joris Kinable)
- Fix for reading escaped quotes in `DOTImporter` (contributed by Victor Mikhaylov)
- Add `BidirectionalDijkstraShortestPath` (contributed by Dimitrios Michail)
- Add external path validator for `KShortestPaths` (contributed by Assaf Mizrachi)
- Add `GmlImporter` (contributed by Dimitrios Michail)
- Fixed bug in HopcroftKarpBipartiteMatching which caused the algorithm to occasionally throw a NullPointerException (contributed by Dimitrios Michail, bug reported by Nils Olberg)
- Fixed `AStarShortestPath` to use Object.equals (contributed by Joris Kinable, bug reported by Zgce)
- Enhance `DirectedAcyclicGraph` to extend Iterable (contributed by Joris Kinable, suggested by Andrew Pennebaker)
- Enhance `MinSourceSinkCut` to make max-flow implementation configurable (contributed by Joris Kinable, suggested by Roman Pearah)
- Add new vertex cover algorithms and package (contributed by Joris Kinable and Nils Olberg)
- Improved GraphML support (contributed by Dimitrios Michail)
- Add common `GraphExporter` and `GraphImporter` interfaces (contributed by Dimitrios Michail)
- DOT importer id fix (contributed by Dimitrios Michail)
- Add `CSVExporter` and `CSVImporter` (contributed by Dimitrios Michail)
- Add `MinimumSTCutAlgorithm` (contributed by Joris Kinable)
- Capture trivial paths in `AllDirectedPaths` (contributed by Andrew Gainer-Dewar)
- Switch from Jalopy source code formatter to Eclipse, since Jalopy does not support java 8 (contributed by John Sichi)
- Fixed a bug in `RandomGraphGenerator`, reported by (@ckapop), which could cause an overflow when calculating the maximum number of edges allowed in a graph (contributed by Dimitrios Michail)
- Added generics to code in test package (contributed by Dimitrios Michail)
- Fixed a bug in `PushRelabelMFImpl`, reported by Joris Kinable, which caused a NullPointerException whenever the network contained multiple components (contributed by Dimitrios Michail)
- Fixed a bug in `MaximumFlowAlgorithmBase`: some vertices ended up with a null prototype vertex (contributed by Dimitrios Michail)
- Use equals for compare to fix bug in `EdmondsBlossomShrinking` (contributed by Szabolcs Besenyei)
- Reformat all file headers (contributed by Joris Kinable)
- Refactor and enhance random graph generators (contributed by Dimitrios Michail)
- Fix DirectedAcyclicGraph.removeAllVertices (contributed by Szabolcs Besenyei)
- Use Travis to enforce Javadoc correctness (contributed by Joris Kinable)
- Corrected all javadoc warnings (contributed by Dimitrios Michail)
- **version 0.9.2** (3-Apr-2016):
- Add `HawickJamesSimpleCycles`, contributed by Luiz Kill
- Add `DOTImporter`, contributed by Wil Selwood
- Optimize `FloydWarshallShortestPaths`, contributed by Mihhail Verhovtsov
- Add VF2 isomorphism and subgraph isomorphism detection, contributed by Fabian Späh
- Remove old experimental isomorphism implementation
- Fix for empty graph input to `KuhnMunkresMinimalWeightBipartitePerfectMatching`, contributed by Szabolcs Besenyei
- Fix for `EdmondsBlossomShrinking`, contributed by Alexey Kudinkin
- Add `TransitiveReduction`, contributed by Christophe Thiebaud
- Add `AStarShortestPath`, contributed by Joris Kinable, Jon Robinson, and Thomas Breitbart
- More `FloydWarshallShortestPaths` optimizations, contributed by Joris Kinable
- Add `MixedGraphUnion` and `AsWeightedDirectedGraph`; fix UndirectedGraphUnion constructors; contributed by Joris Kinable
- Add `GabowStrongConnectivityInspector` and `KosarajuStrongConnectivityInspector`, contributed by Joris Kinable and Sarah Komla-Ebri
- Add `PushRelabelMaximumFlow`; boost `EdmondsKarpMaximumFlow`; add `MaximumFlowAlgorithm` interface; add `Pair` and `Extension` utility classes; optional seed parameter to `RandomGraphGenerator`, contributed by Alexey Kudinkin
- Add `MaximumWeightBipartiteMatching`, contributed by Graeme Ahokas
- Osgify jgrapht-ext, contributed by Christoph Zauner
- Add `AllDirectedPaths`, contributed by Andrew Gainer-Dewar
- **version 0.9.1** (5-Apr-2015):
- Auto-generation of bundle manifest, contributed by Nicolas Fortin
- Travis CI configuration, contributed by Peter Goldstein
- TarjanLCA bugfix, contributed by Leo Crawford
- Add `SimpleGraphPath`, contributed by Rodrigo Lopez Dato
- Add `NaiveLcaFinder`, contributed by Leo Crawford
- Make getEdgeWeight throw NPE on null edge, suggested by Joris Kinable
- Clarify that shortest path length is weighted, per gjafachini
- Add DAG constructor that takes an edge factory, and make TarjanLCA constructor public, contributed by Anders Wallgren
- Fixed rounding error in graph generation, contributed by Siarhei
- Fixed Javadoc for `DirectedWeightedMultigraph`, noticed by Martin Lowinski
- Use annotations to simplify test suites, contributed by Jan Altenbernd
- Add missing Override/Deprecated annotations, contributed by Jan Altenbernd
- Update maven-compiler-plugin version, contributed by Andrew Chen
- Add builder package, contributed by Andrew Chen
- Add CliqueMinimalSeparatorDecomposition, contributed by Florian Buenzli, Thomas Tschager, Tomas Hruz, and Philipp Hoppen
- Include vertex #toString value in excn message, contributed by Chris Wensel
- Open up Specifics to allow for custom backing containers, contributed by Chris Wensel
- Make abstract graph constructors protected, contributed by John Sichi
- Moved to JDK 1.7
- **version 0.9.0** (06-Dec-2013):
- Move to github for source control, and Apache Maven for build, contributed by Andreas Schnaiter, Owen Jacobson, and Isaac Kleinman.
- Add source/target vertices to edge events to fix sf.net bug 3486775, spotted by Frank Mori Hess.
- Add `EdmondsBlossomShrinking` algorithm, contributed by Alejandro R. Lopez del Huerto.
- Fix empty diameter calculation in `FloydWarshallShortestPaths`, contributed by Ernst de Ridder (bug spotted by Jens Lehmann)
- Add `HopcroftKarpBipartiteMatching` and `MinSourceSinkCut`, contributed by Joris Kinable
- Fix multiple bugs in `StoerWagnerMinimumCut`, contributed by Ernst de Ridder
- Fix path weight bug in `FloydWarshallShortestPaths`, contributed by Michal Pasieka
- Add `PrimMinimumSpanningTree`, contributed by Alexey Kudinkin
- Add `DirectedWeightedPseudograph`, and fix 'DirectedMultigraph' contributed by Adam Gouge
- More KSP bugfixes (spotted by Sebastian Mueller, fixed by Guillaume Boulmier)
- Add `KuhnMunkresMinimalWeightBipartitePerfectMatching` and associated generators+interfaces (contributed by Alexey Kudinkin)
- Add cycle enumeration (contributed by Nikolay Ognyanov, originally from http://code.google.com/p/niographs/ )
- Update `removeAllEdges` to match specification (contributed by Graham Hill)
- Add `TarjanLowestCommonAncestor`, contributed by Leo Crawford
- Add `JGraphXAdapter`, contributed by Sebastian Hubenschmid and JeanYves Tinevez
- Add LGPL/EPL dual licensing, coordinated by Oliver Kopp
- Refactoring for `DirectedAcyclicGraph`, contributed by Javier Gutierrez
- **version 0.8.3** (20-Jan-2012):
- fix regression in `DOTExporter` inadvertently introduced by `0.8.2` changes.
- Add `GridGraphGenerator`, contributed by Assaf Mizrachi.
- Return coloring from ChromaticNumber, contributed by Harshal Vora.
- Fix bugs in KSP, contributed by Guillaume Boulmier; note that these bugfixes worsen the running time.
- Fix an object identity bug in CycleDetector, contributed by Matt Sarjent.
-Add StoerWagnerMinimumCut, contributed by Robby McKilliam.
- Fix `MANIFEST.MF`, spotted by Olly.
- Make `FloydWarshallShortestPaths.getShortestPaths` unidirectional, contributed by Yuriy Nakonechnyy.
- **version 0.8.2** (27-Nov-2010):
- Clean up `FibonacciHeapNode` constructor, as suggested by Johan
Henriksson.
- Optimize and enhance `FloydWarshallShortestPaths`, contributed by Soren Davidsen.
- Optimize `ChromaticNumber`,pointed out by gpaschos@netscape.net.
- Add unit test for `FloydWarshallShortestPaths` for bug noticed by
Andrea Pagani.
- Add vertex factory validation to `RandomGraphGenerator` to prevent a confusing problem encountered by Andrea Pagani.
- Add `KruskalMinimumSpanningTree` and `UnionFind`, contributed by Tom Conerly.
- Add attributes to `DOTExporter`, based on suggestion from Chris Lott.
- Fix inefficient assertion in `TopologicalOrderIterator`, spotted by
Peter Lawrey.
- Fix induced subgraph bug with addition of edge to underlying graph, contributed by Michele Mancioppi.
- Make `getEdgeWeight` delegate to `DefaultWeightedEdge.getWeight`, spotted by Michael Lindig.
- Add maven support, contributed by Adrian Marte.
- **version 0.8.1** (3-Jul-2009):
- Enhanced `GmlExporter` with customized labels and ID's, contributed by Trevor Harmon.
- Added new algorithms `HamiltonianCycle`, `ChromaticNumber` and `EulerianCircuit`, plus new generators `HyperCubeGraphGenerator`, `StarGraphGenerator`, and `CompleteBipartiteGraphGenerator`, all contributed by Andrew Newell.
- Fix bug with vertices which are equals but not identity-same in graphs allowing loops, spotted by Michael Michaud.
- Fix bug in `EquivalenceIsomorphismInspector`, reported by Tim Engler. - Add `toString` for shortest paths wrapper, spotted by Achim Beutel.
- Add `FloydWarshallShortestPaths`, contributed by Tom Larkworthy.
- Enhance `DijskstraShortestPath` to support `GraphPath` interface.
- Add `GraphUnion` (with directed and undirected variants), contributed by Ilya Razenshteyn.
- **version 0.8.0** (Sept-2008):
- Moved to JDK 1.6.
- Fixed problem with `RandomGraphGenerator` reported by Mario Rossi.
- Added `CompleteGraphGenerator`, contributed by Tim Shearouse.
- Fixed `FibonacciHeap` performance problem reported by Jason Lenderman.
- Made `DotExporter` reject illegal vertex ID's, contributed by Holger Brandl.
- Fixed bogus assertion for topological sort over empty
graph, spotted by Harris Lin.
- Added scale-free graph generator and `EdmondsKarpMaximumFlow`, contributed by Ilya Razenshteyn.
- Added `DirectedAcyclicGraph`, contributed by Peter Giles.
- Added protected `getWeight` accessor to `DefaultWeightedEdge`, likewise `getSource` and `getTarget` on `DefaultEdge`.
- Optimized iterators to skip calling event firing routines when there are no listeners, and used `ArrayDeque` in a number of places, per suggestion from Ross Judson.
- Improvements to `StrongConnectivityInspector` and OSGi bundle support contributed by Christian Soltenborn.
- **version 0.7.3** (Jan-2008):
- Patch to `JGraphModelAdapter.removeVertex` provided by Hookahey.
- Added `ParanoidGraph`.
- Removed obsolete `ArrayUtil` (spotted by Boente).
- Added `GraphPath`, and used it to fix mistake in `0.7.2` (k-shortest-paths was returning a private data structure,
as discovered by numerous users).
- Fixed `EdgeReversedGraph.getAllEdges` (spotted by neumanns@users.sf.net).
- Fixed incorrect assertion in `TopologicalOrderIterator` constructor.
- Enabled assertions in JUnit tests.
- Fixed NPE in `BellmanFordShortestPath.getCost`.
- Fixed a few problems spotted by findbugs.
- **version 0.7.2** (Sept-2007):
- Added `TransitiveClosure`, contributed by Vinayak Borkar.
- Added biconnectivity/cutpoint inspection, k-shortest-paths, and masked
subgraphs, all contributed by Guillaume Boulmier.
- Made some Graphs helper methods even more generic, as suggested by JongSoo.
- Test and fixes for (Directed)NeighborIndex submitted by Andrew Berman.
- Added `AsUnweighted(Directed)Graph` and `AsWeightedGraph`, contributed by Lucas Scharenbroich.
- Dropped support for retroweaver.
- **version 0.7.1** (March-2007):
- Fixed some bugs in `CycleDetector` reported by Khanh Vu, and added more testcases for it.
- Fixed bugs in `DepthFirstIterator` reported by Welson Sun, and added WHITE/GRAY/BLACK states and `vertexFinished` listener event.
- Exposed `Subgraph.getBase()`, and parameterized `Subgraph` on graph type (per suggestion from Aaron Harnly).
- Added `EdgeReversedView`.
- Added `GmlExporter` (contributed by Dimitrios Michail), plus `DOTExporter` and `GraphMLExporter` (both contributed by Trevor Harmon).
- Enhanced `TopologicalOrderIterator` to take an optional Queue parameter for tie-breaking (per suggestion from JongSoo Park).
- Fixed some documentation errors reported by Guillaume Boulmier.
- **version 0.7.0** (July-2006) :
- Upgraded to JDK 1.5 (generics support added by Christian Hammer with help from Hartmut Benz and John Sichi).
- Added `(Directed)NeighborIndex` and `MatrixExporter`, contributed by Charles Fry.
- Added BellmanFord, contributed by Guillaume Boulmier of France Telecom.
- Removed never-used `LabeledElement`.
- Renamed package from `org._3pq.jgrapht` to `org.jgrapht`.
- Made various breaking change to interfaces; edge collections are now Sets, not Lists.
- Added Touchgraph converter, contributed by Carl Anderson
- **version 0.6.0** (July-2005) :
- Upgraded to JDK 1.4, taking advantage of its new linked hash set/map containers to make edge/vertex set order-deterministic
- Added support for custom edge lists.
- Fixed various serialization and Subgraph issues.
- Added to `JGraphModelAdapter` support for JGraph's "dangling" edges; its constructors have slightly changed and now forbid `null` values.
- Improved interface to `DijskstraShortestPath`, and added radius support to `ClosestFirstIterator`.
- Added new `StrongConnectivityInspector` algorithm (contributed by Christian Soltenborn) and `TopologicalOrderIterator` (contributed by Marden Neubert).
- Deleted deprecated `TraverseUtils`.
- Upgraded to JGraph `5.6.1.1`.
- **version 0.5.3** (June-2004) :
- Removed Subgraph verification of element's identity to base graph, upgraded to JGraph 4.0
- Added the `VisioExporter` which was contributed by Avner Linder
- minor bug fixes and improvements.
- **version 0.5.2** (March-2004) :
- Serialization improvements, fixes to subgraphs and listenable graphs
- added support for JGraph > JGraphT change propagation for JGraph adapter (contributed by Erik Postma)
- upgraded to JGraph 3.1, various bug fixes and improvements.
- **version 0.5.1** (November-2003) :
- Semantics of `Graph.clone()` has changed, please check the documentation if you're using it.
- Added Dijkstra's shortest path, vertex cover approximations, new graph generation framework
- upgraded to JGraph 3.0
- various bug fixes and API improvements.
- **version 0.5.0** (14-Aug-2003) :
- a new connectivity inspector added
- edge API refactored to be simpler
- improved ant build
- improved event model
- all known bugs were fixed, documentation clarifications, other small improvements.
- API of 0.5.0 is not 100% backward compatible with 0.4.1 but upgrade is simple and straightforward.
- **version 0.4.1** (05-Aug-2003) :
- A new adapter to JGraph that provides graph visualizations, new depth-first and breadth-first iteration algorithms
- various bug fixes and refactoring
- moved unit-tests to a separate folder hierarchy and added more unit-tests.
- **version 0.4.0** (July-2003) : Initial public release.
jgrapht-jgrapht-1.5.2/README.md 0000664 0000000 0000000 00000025761 14424254415 0016112 0 ustar 00root root 0000000 0000000 
[](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22jgrapht%22)
[](https://oss.sonatype.org/content/repositories/snapshots/org/jgrapht/jgrapht-core/)
[](http://www.gnu.org/licenses/lgpl-2.1.html)
[](http://www.eclipse.org/legal/epl-2.0)
[](https://www.java.com/)
# JGraphT
Released: May 2, 2023
Written by [Barak Naveh](mailto:barak_naveh@users.sourceforge.net) and Contributors
(C) Copyright 2003-2023, by Barak Naveh and Contributors. All rights
reserved.
Please address all contributions, suggestions, and inquiries to the [user mailing list](https://lists.sourceforge.net/lists/listinfo/jgrapht-users)
## Introduction
JGraphT is a free Java class library that provides mathematical graph-theory objects and algorithms. It runs on Java 2 Platform (requires JDK 11 or later starting with JGraphT 1.5.0).
JGraphT may be used under the terms of either the
* GNU Lesser General Public License (LGPL) 2.1
or the
* Eclipse Public License (EPL)
As a recipient of JGraphT, you may choose which license to receive the code under.
For detailed information on the dual license approach, see .
A copy of the [EPL license](license-EPL.txt) and the [LPGL license](license-LGPL.txt) is included in the download.
Please note that JGraphT is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Please refer to the license for details.
SPDX-License-Identifier: LGPL-2.1-or-later OR EPL-2.0
## Release Contents
The files below make up the table of contents for a release distribution archive (produced by `mvn package`):
- `README.md` this file
- `CONTRIBUTORS.md` list of contributors
- `HISTORY.md` changelog
- `license-EPL.txt` Eclipse Public License 2.0
- `license-LGPL.txt` GNU Lesser General Public License 2.1
- `javadoc/` Javadoc documentation
- `lib/` JGraphT libraries and dependencies:
- `jgrapht-core-x.y.z.jar` core library
- `jgrapht-demo-x.y.z.jar` demo classes
- `jgrapht-opt-x.y.z.jar` optimized graph implementations
- `jgrapht-ext-x.y.z.jar` extensions
- `jgrapht-io-x.y.z.jar` Importers/Exporters for various graph formats
- `jgrapht-guava-x.y.z.jar` Adapter classes for the Guava library
- `jgrapht-unimi-dsi-x.y.z.jar` Webgraph adapter and succinct graph implementations
- `jgraphx-a.b.c.jar` JGraphX dependency library
- `jheaps-x.y.jar` JHeaps library
- `antlr4-runtime-x.y.jar` ANTLR parser runtime
- `commons-lang3-x.y.z.jar` Apache Commons Lang library
- `commons-text-x.y.jar` Apache Commons Text library
- `fastutil-x.y.z.jar` Fastutil library
- `guava-x.y-jre.jar` Guava library
- `jsap-x.y.jar` Jsap library
- `logback-classic-x.y.z.jar` Logger
- `logback-core-x.y.z.jar` Logger
- `slf4j-api-x.y.z.jar` Logger api
- `sux4j-x.y.z.jar` Sux4j library
- `webgraph-x.y.z.jar` Webgraph library
- `webgraph-big-z.y.z.jar` Webgraph big library
- `apfloat-x.x.x.jar` Apfloat library
- `source/` complete source tree used to build this release
## Getting Started ##
The JGraphT [wiki](https://github.com/jgrapht/jgrapht/wiki) provides various helpful pages for new users, including a [How to use JGraphT in your projects](https://github.com/jgrapht/jgrapht/wiki/Users%3A-How-to-use-JGraphT-as-a-dependency-in-your-projects) page.
The package `org.jgrapht.demo` includes small demo applications to help you get started. If you spawn your own demo app and think others can use it, please send it to us and we will add it to that package.
To run the graph visualization demo from the downloaded release, try executing this command in the lib directory:
java -jar jgrapht-demo-x.y.z.jar
More information can be found on the [user pages](https://github.com/jgrapht/jgrapht/wiki#user-pages) of our wiki. Finally, all classes come with corresponding test classes. These test classes contain many examples.
To help us understand how you use JGraphT, and which features are important to you, [tell](https://github.com/jgrapht/jgrapht/wiki/Projects-Using-JGraphT) us how you are using JGraphT, and [cite](https://github.com/jgrapht/jgrapht/wiki/How-to-cite-JGraphT) the usage of JGraphT in your book, paper, website, or technical report.
## Using via Maven
Starting from 0.9.0, every JGraphT release is published to the Maven Central Repository. You can add a dependency from your project as follows:
```xml
org.jgraphtjgrapht-core1.5.2
```
We have also started auto-publishing SNAPSHOT builds for every successful commit to master. To use the bleeding edge:
```xml
org.jgraphtjgrapht-core1.5.3-SNAPSHOT
```
and make sure the snapshot repository is enabled:
```xml
maven-snapshotshttp://oss.sonatype.org/content/repositories/snapshotsdefaultfalsetrue
```
## Upgrading Versions
To help upgrading, JGraphT maintains a one-version-backwards compatibility. While this compatibility is not a hard promise, it is generally respected. (This policy was not followed for the jump from `0.6.0` to `0.7.0` due to the pervasive changes required for generics.) You can upgrade via:
- **The safe way**: compile your app with the JGraphT version that immediately follows your existing version and follow the deprecation notes, if they exist, and modify your application accordingly. Then move to the next version, and on, until you're current.
- **The fast way**: go to the latest JGraphT right away - if it works, you're done.
Reading the [change history](HISTORY.md) is always recommended.
## Documentation
A local copy of the Javadoc HTML files is included in the distribution. The latest version of these files is also available [on-line](http://www.jgrapht.org/javadoc).
## Dependencies
- JGraphT requires JDK 11 or later to build starting with version 1.5.0.
- [JHeaps](http://www.jheaps.org/) is a library with priority queues. JHeaps is licensed under the terms of the Apache License, Version 2.0.
- [JUnit](http://www.junit.org) is a unit testing framework. You need JUnit only if you want to run the unit tests. JUnit is licensed under the terms of the IBM Common Public License. The JUnit tests included with JGraphT have been created using JUnit 4.
- [XMLUnit](http://xmlunit.sourceforge.net) extends JUnit with XML capabilities. You need XMLUnit only if you want to run the unit tests. XMLUnit is licensed under the terms of the BSD License.
- [JGraphX](https://github.com/jgraph/jgraphx) is a graph visualizations and editing component (the successor to the older JGraph library). You need JGraphX only if you want to use the JGraphXAdapter to visualize the JGraphT graph interactively via JGraphX. JGraphX is licensed under the terms of the BSD license.
- [ANTLR](http://www.antlr.org) is a parser generator. It is used for reading text files containing graph representations, and is only required by the jgrapht-io module. ANTLR v4 is licensed under the terms of the [BSD license](http://www.antlr.org/license.html).
- [Guava](https://github.com/google/guava) is Google's core libraries for Java. You need Guava only if you are already using Guava's graph data-structures and wish to use our adapter classes in order to execute JGraphT's algorithms. Only required by the jgrapht-guava module.
- [Apache Commons Proper](http://commons.apache.org/components.html) is an Apache project containing reusable Java components. The packages [commons-text](https://commons.apache.org/proper/commons-text/) and [commons-lang3.](http://commons.apache.org/proper/commons-lang/) which provide additional utilities for String manipulation are only required by the jgrapht-io module. The package [commons-math](https://commons.apache.org/proper/commons-text/) is only required by the jgrapht-unimi-dsi module.
- [fastutil](http://fastutil.di.unimi.it/) provides a collection of type-specific maps, sets, lists and queues with a small memory footprint and fast access and insertion. Fastutil is only required by the jgrapht-opt module.
- [webgraph](http://webgraph.di.unimi.it/) provides a framework for graph compression enabling management of very large graphs. Webgraph is only required by the jgrapht-unimi-dsi module.
- [sux4j](http://sux.di.unimi.it/) provides implementations of basic succinct data structures. Sux4j is only required by the jgrapht-unimi-dsi module.
- [jsap](http://www.martiansoftware.com/jsap/) provides a simple argument parser. Jsap is only required by the jgrapht-unimi-dsi module.
- [apfloat](http://www.apfloat.org/apfloat_java/) provides support for high performance arbitrary precision arithmetic. Apfloat is licensed under the terms of the MIT license.
## Online Resources
The JGraphT website is at . You can use this site to:
- **Obtain the latest version**: latest version and all previous versions of JGraphT are available online.
- **Report bugs**: if you have any comments, suggestions or bugs you want to report.
- **Get support**: if you have questions or need help with JGraphT.
There is also a [wiki](https://github.com/jgrapht/jgrapht/wiki) set up for everyone in the JGraphT community to share information about the project. For support, refer to our [support page](https://github.com/jgrapht/jgrapht/wiki/Getting-Support)
Source code is hosted on [github](https://github.com/jgrapht/jgrapht). You can send contributions as pull requests there.
## Your Improvements
If you add improvements to JGraphT please send them to us as [pull requests on github](https://github.com/jgrapht/jgrapht/wiki/How-to-make-your-first-%28code%29-contribution). We will add them to the next release so that everyone can enjoy them. You might also benefit from it: others may fix bugs in your source files or may continue to enhance them.
## Thanks
With regards from
[Barak Naveh](mailto:barak_naveh@users.sourceforge.net), JGraphT Project Creator
[John Sichi](mailto:perfecthash@users.sourceforge.net), JGraphT Project Administrator
[Joris Kinable](https://github.com/jkinable), JGraphtT Project Reviewer/Committer and Release Manager
[Dimitrios Michail](https://github.com/d-michail), JGraphT Project Reviewer/Committer
jgrapht-jgrapht-1.5.2/docs/ 0000775 0000000 0000000 00000000000 14424254415 0015550 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/docs/CNAME 0000664 0000000 0000000 00000000014 14424254415 0016311 0 ustar 00root root 0000000 0000000 jgrapht.org
jgrapht-jgrapht-1.5.2/docs/Gemfile 0000664 0000000 0000000 00000000174 14424254415 0017045 0 ustar 00root root 0000000 0000000 source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
gem 'jekyll-redirect-from', group: :jekyll_plugins
jgrapht-jgrapht-1.5.2/docs/Gemfile.lock 0000664 0000000 0000000 00000016175 14424254415 0020004 0 ustar 00root root 0000000 0000000 GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.4.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.23.8)
concurrent-ruby (1.2.2)
dnsruby (1.61.9)
simpleidn (~> 0.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (228)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.3)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.4.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.8.0)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.2.0)
jekyll-theme-cayman (= 0.2.0)
jekyll-theme-dinky (= 0.2.0)
jekyll-theme-hacker (= 0.2.0)
jekyll-theme-leap-day (= 0.2.0)
jekyll-theme-merlot (= 0.2.0)
jekyll-theme-midnight (= 0.2.0)
jekyll-theme-minimal (= 0.2.0)
jekyll-theme-modernist (= 0.2.0)
jekyll-theme-primer (= 0.6.0)
jekyll-theme-slate (= 0.2.0)
jekyll-theme-tactile (= 0.2.0)
jekyll-theme-time-machine (= 0.2.0)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.12.0)
kramdown (= 2.3.2)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.4)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.13.6, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.17.9)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (3.9.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (>= 0.7, < 2)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.7.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.4.0)
commonmarker (~> 0.22)
jekyll-commonmark-ghpages (0.4.0)
commonmarker (~> 0.23.7)
jekyll (~> 3.9.0)
jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 5.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.6.0)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.2)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.1)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.18.0)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
PLATFORMS
ruby
DEPENDENCIES
github-pages
jekyll-redirect-from
BUNDLED WITH
2.3.9
jgrapht-jgrapht-1.5.2/docs/LGPL.html 0000664 0000000 0000000 00000072635 14424254415 0017211 0 ustar 00root root 0000000 0000000
LGPL
GNU Lesser General Public License
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software
Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the
first released version of the Lesser GPL. It also counts as the successor
of the GNU Library Public License, version 2, hence the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public Licenses are
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the Free
Software Foundation and other authors who decide to use it. You can use it
too, but we suggest you first think carefully about whether this license or
the ordinary General Public License is the better strategy to use in any
particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not
price. Our General Public Licenses are designed to make sure that you have
the freedom to distribute copies of free software (and charge for this
service if you wish); that you receive source code or can get it if you want
it; that you can change the software and use pieces of it in new free
programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for you if
you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or
for a fee, you must give the recipients all the rights that we gave you. You
must make sure that they, too, receive or can get the source code. If you
link other code with the library, you must provide complete object files to
the recipients, so that they can relink them with the library after making
changes to the library and recompiling it. And you must show them these
terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal permission
to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is
no warranty for the free library. Also, if the library is modified by
someone else and passed on, the recipients should know that what they have
is not the original version, so that the original author's reputation will
not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any
free program. We wish to make sure that a company cannot effectively
restrict the users of a free program by obtaining a restrictive license from
a patent holder. Therefore, we insist that any patent license obtained for a
version of the library must be consistent with the full freedom of use
specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License. This license, the GNU Lesser General Public
License, applies to certain designated libraries, and is quite different
from the ordinary General Public License. We use this license for certain
libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a
shared library, the combination of the two is legally speaking a combined
work, a derivative of the original library. The ordinary General Public
License therefore permits such linking only if the entire combination fits
its criteria of freedom. The Lesser General Public License permits more lax
criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does
Less to protect the user's freedom than the ordinary General Public License.
It also provides other free software developers Less of an advantage over
competing non-free programs. These disadvantages are the reason we use the
ordinary General Public License for many libraries. However, the Lesser
license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage
the widest possible use of a certain library, so that it becomes a de-facto
standard. To achieve this, non-free programs must be allowed to use the
library. A more frequent case is that a free library does the same job as
widely used non-free libraries. In this case, there is little to gain by
limiting the free library to free software only, so we use the Lesser
General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of free
software. For example, permission to use the GNU C Library in non-free
programs enables many more people to use the whole GNU operating system, as
well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is linked
with the Library has the freedom and the wherewithal to run that program
using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a "work
based on the library" and a "work that uses the library". The former
contains code derived from the library, whereas the latter must be combined
with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some of
those functions and data) to form executables.
The "Library", below, refers to any such software library or work which
has been distributed under these terms. A "work based on the Library" means
either the Library or any derivative work under copyright law: that is to
say, a work containing the Library or a portion of it, either verbatim or
with modifications and/or translated straightforwardly into another
language. (Hereinafter, translation is included without limitation in the
term "modification".)
"Source code" for a work means the preferred form of the work for making
modifications to it. For a library, complete source code means all the
source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and
installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running a
program using the Library is not restricted, and output from such a program
is covered only if its contents constitute a work based on the Library
(independent of the use of the Library in a tool for writing it). Whether
that is true depends on what the Library does and what the program that uses
the Library does.
1. You may copy and distribute verbatim copies of the Library's complete
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the notices
that refer to this License and to the absence of any warranty; and
distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of
it, thus forming a work based on the Library, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you
also meet all of these conditions:
* a) The modified work must itself be a software library.
* b) You must cause the files modified to carry prominent notices stating
that you changed the files and the date of any change.
* c) You must cause the whole of the work to be licensed at no charge to
all third parties under the terms of this License.
* d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses the
facility, other than as an argument passed when the facility is invoked,
then you must make a good faith effort to ensure that, in the event an
application does not supply such function or table, the facility still
operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a
purpose that is entirely well-defined independent of the application.
Therefore, Subsection 2d requires that any application-supplied function or
table used by this function must be optional: if the application does not
supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you
distribute them as separate works. But when you distribute the same sections
as part of a whole which is a work based on the Library, the distribution of
the whole must be on the terms of this License, whose permissions for other
licensees extend to the entire whole, and thus to each and every part
regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or collective
works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of a
storage or distribution medium does not bring the other work under the scope
of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do this,
you must alter all the notices that refer to this License, so that they
refer to the ordinary GNU General Public License, version 2, instead of to
this License. (If a newer version than version 2 of the ordinary GNU General
Public License has appeared, then you can specify that version instead if
you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that
copy, so the ordinary GNU General Public License applies to all subsequent
copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the
Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete
corresponding machine-readable source code, which must be distributed under
the terms of Sections 1 and 2 above on a medium customarily used for
software interchange.
If distribution of object code is made by offering access to copy from a
designated place, then offering equivalent access to copy the source code
from the same place satisfies the requirement to distribute the source code,
even though third parties are not compelled to copy the source along with
the object code.
5. A program that contains no derivative of any portion of the Library,
but is designed to work with the Library by being compiled or linked with
it, is called a "work that uses the Library". Such a work, in isolation, is
not a derivative work of the Library, and therefore falls outside the scope
of this License.
However, linking a "work that uses the Library" with the Library creates
an executable that is a derivative of the Library (because it contains
portions of the Library), rather than a "work that uses the library". The
executable is therefore covered by this License. Section 6 states terms for
distribution of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative
work of the Library even though the source code is not. Whether this is true
is especially significant if the work can be linked without the Library, or
if the work is itself a library. The threshold for this to be true is not
precisely defined by law.
If such an object file uses only numerical parameters, data structure
layouts and accessors, and small macros and small inline functions (ten
lines or less in length), then the use of the object file is unrestricted,
regardless of whether it is legally a derivative work. (Executables
containing this object code plus portions of the Library will still fall
under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are
linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a
"work that uses the Library" with the Library to produce a work containing
portions of the Library, and distribute that work under terms of your
choice, provided that the terms permit modification of the work for the
customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by this
License. You must supply a copy of this License. If the work during
execution displays copyright notices, you must include the copyright notice
for the Library among them, as well as a reference directing the user to the
copy of this License. Also, you must do one of these things:
* a) Accompany the work with the complete corresponding machine-readable
source code for the Library including whatever changes were used in the work
(which must be distributed under Sections 1 and 2 above); and, if the work
is an executable linked with the Library, with the complete machine-readable
"work that uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified executable
containing the modified Library. (It is understood that the user who changes
the contents of definitions files in the Library will not necessarily be
able to recompile the application to use the modified definitions.)
* b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a copy of the
library already present on the user's computer system, rather than copying
library functions into the executable, and (2) will operate properly with a
modified version of the library, if the user installs one, as long as the
modified version is interface-compatible with the version that the work was
made with.
* c) Accompany the work with a written offer, valid for at least three
years, to give the same user the materials specified in Subsection 6a,
above, for a charge no more than the cost of performing this distribution.
* d) If distribution of the work is made by offering access to copy from
a designated place, offer equivalent access to copy the above specified
materials from the same place.
* e) Verify that the user has already received a copy of these materials
or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library"
must include any data and utility programs needed for reproducing the
executable from it. However, as a special exception, the materials to be
distributed need not include anything that is normally distributed (in
either source or binary form) with the major components (compiler, kernel,
and so on) of the operating system on which the executable runs, unless that
component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions
of other proprietary libraries that do not normally accompany the operating
system. Such a contradiction means you cannot use both them and the Library
together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library
side-by-side in a single library together with other library facilities not
covered by this License, and distribute such a combined library, provided
that the separate distribution of the work based on the Library and of the
other library facilities is otherwise permitted, and provided that you do
these two things:
* a) Accompany the combined library with a copy of the same work based on
the Library, uncombined with any other library facilities. This must be
distributed under the terms of the Sections above.
* b) Give prominent notice with the combined library of the fact that
part of it is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the
Library except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, link with, or distribute the Library
is void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such parties
remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the
Library (or any work based on the Library), you indicate your acceptance of
this License to do so, and all its terms and conditions for copying,
distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the original
licensor to copy, distribute, link with or modify the Library subject to
these terms and conditions. You may not impose any further restrictions on
the recipients' exercise of the rights granted herein. You are not
responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot distribute so
as to satisfy simultaneously your obligations under this License and any
other pertinent obligations, then as a consequence you may not distribute
the Library at all. For example, if a patent license would not permit
royalty-free redistribution of the Library by all those who receive copies
directly or indirectly through you, then the only way you could satisfy both
it and this License would be to refrain entirely from distribution of the
Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any such
claims; this section has the sole purpose of protecting the integrity of the
free software distribution system which is implemented by public license
practices. Many people have made generous contributions to the wide range of
software distributed through that system in reliance on consistent
application of that system; it is up to the author/donor to decide if he or
she is willing to distribute software through any other system and a
licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be
a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions
of the Lesser General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail
to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Library does not specify a license version
number, you may choose any version ever published by the Free Software
Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these, write to
the author to ask for permission. For software which is copyrighted by the
Free Software Foundation, write to the Free Software Foundation; we
sometimes make exceptions for this. Our decision will be guided by the two
goals of preserving the free status of all derivatives of our free software
and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER
SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General
Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
< one line to give the library's name and a brief idea of what it does. >
Copyright (C) < year > < name of author >
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob'
(a library for tweaking knobs) written by James Random Hacker.
< signature of Ty Coon >, 1 April 1990
Ty Coon, President of Vice
{% include analytics.html %}
jgrapht-jgrapht-1.5.2/docs/_posts/ 0000775 0000000 0000000 00000000000 14424254415 0017057 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-01-intro.md 0000775 0000000 0000000 00000003437 14424254415 0021561 0 ustar 00root root 0000000 0000000 ---
title: "Home"
bg: white
color: black
style: center
---
### a Java library of graph theory data structures and algorithms
{: .text-blue}
#### now with [Python bindings](https://pypi.org/project/jgrapht) too!
{: .text-blue}
### *flexible*
##### **any object** can be used for vertex and edge types, with full **type safety** via generics
##### edges can be **directed** or **undirected**, **weighted** or **unweighted**
##### **simple graphs**, **multigraphs**, and **pseudographs**
##### **unmodifiable** graphs allow modules to provide "read-only" access to internal graphs
##### **listenable** graphs allow external listeners to track modification events
##### live **subgraph** views on other graphs
##### **compositions** and **converter views** for combining and adapting graphs
##### **customizable** incidence and adjacency representations
### *powerful*
##### specialized **iterators** for graph traversal (**DFS**, **BFS**, etc)
##### **algorithms** for path finding, clique detection, isomorphism detection, coloring, common ancestors, tours, connectivity, matching, cycle detection, partitions, cuts, flows, centrality, spanning, **and the list goes on**
##### **exporters** and **importers** for popular external representations such as GraphViz
##### **live adapters** to other graph libraries such as **JGraphX visualization** and **Guava Graphs**
##### **generators** and **transforms**
### *efficient*
##### designed for performance, with **near-native** speed in many cases
##### adapters for memory-optimized **fastutil** representation
##### **sparse** representations for immutable graphs
Fork me on GitHub
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-02-jumpstart.md 0000775 0000000 0000000 00000001644 14424254415 0022456 0 ustar 00root root 0000000 0000000 ---
title: "Jumpstart"
bg: green
color: black
fa-icon: bolt
---
## Maven
JGraphT releases are published to the **Maven Central Repository**, so you can
easily add us as a dependency to your project:
(There are also [instructions](https://github.com/jgrapht/jgrapht#using-via-maven) for how to use the latest **SNAPSHOT** build instead.)
## Development Environment
First, find out how to set up [your favorite IDE (or the command line)](https://github.com/jgrapht/jgrapht/wiki/Users:-How-to-use-JGraphT-as-a-dependency-in-your-projects) to work with JGraphT.
## Hello JGraphT
Next, try compiling and running the [hello world](guide/HelloJGraphT) example.
Once you get that working, dig into the [user guide](guide/UserOverview) to learn more about JGraphT!
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-03-docs.md 0000775 0000000 0000000 00000001562 14424254415 0021355 0 ustar 00root root 0000000 0000000 ---
title: "Docs"
bg: blue
color: black
fa-icon: book
---
## [README](https://github.com/jgrapht/jgrapht/blob/master/README.md)
## [User Guide](guide/UserOverview)
## [Wiki](https://github.com/jgrapht/jgrapht/wiki)
## [Javadoc for latest release](javadoc)
## [Javadoc for latest SNAPSHOT build](javadoc-SNAPSHOT)
## Javadoc for older releases, e.g. [javadoc-1.0.0](javadoc-1.0.0)
## [Documentation for python bindings](https://python-jgrapht.readthedocs.io)
## [Research Paper in ACM TOMS](https://dl.acm.org/doi/10.1145/3381449)
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-04-download.md 0000775 0000000 0000000 00000002252 14424254415 0022232 0 ustar 00root root 0000000 0000000 ---
title: "Download"
bg: turquoise
color: white
fa-icon: cloud-download
style: center
---
# Latest Release
For development without Maven, or for [running demos from the command
line](https://github.com/jgrapht/jgrapht/wiki/Users:-Running-JGraphT-demos), you can download a full archive of the release:
Regardless of which archive format you download, you'll have the same [release contents](https://github.com/jgrapht/jgrapht#release-contents) after unpacking.
# Historical Releases
[Older releases](http://sourceforge.net/project/showfiles.php?group_id=86459&package_id=89784) are also available. They have less functionality, but may be useful with obsolete JDK's or JRE's.
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-05-community.md 0000664 0000000 0000000 00000002113 14424254415 0022441 0 ustar 00root root 0000000 0000000 ---
title: "Community"
bg: purple
color: white
fa-icon: users
---
## Get answers on [StackOverflow](https://stackoverflow.com/questions/tagged/jgrapht)
## Browse [known issues](https://github.com/jgrapht/jgrapht/issues) or report [a new issue](https://github.com/jgrapht/jgrapht/wiki/Users:-Getting-Support)
## Join [the user mailing list](https://sourceforge.net/projects/jgrapht/lists/jgrapht-users)
## Check out [open pull requests](https://github.com/jgrapht/jgrapht/pulls)
## Learn how to [contribute your first improvement](https://github.com/jgrapht/jgrapht/wiki/Dev-guide:-Become-a-Contributor)
## Tell us your success story: [how are you are using JGraphT?](https://github.com/jgrapht/jgrapht/wiki/Users:-Projects-Using-JGraphT)
## Cite JGraphT [in your research](https://github.com/jgrapht/jgrapht/wiki/Users:-How-to-cite-JGraphT)
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-06-news.md 0000664 0000000 0000000 00000001633 14424254415 0021400 0 ustar 00root root 0000000 0000000 ---
title: "News"
bg: orange
color: white
fa-icon: exclamation
style: center
---
## **29-Jun-2020:** First Release of Python Bindings!
### Read the [announcement](https://medium.com/@dimitrios.michail/announcing-the-python-bindings-of-jgrapht-918d0cf386de) here.
## **14-Jun-2020:** Release 1.5.0 is now available!
### Read the [release announcement](https://sourceforge.net/p/jgrapht/news/2020/06/jgrapht-version-150-released/) for more info.
## **21-May-2020:** JGraphT Research Paper Published!
### [Our paper](https://dl.acm.org/doi/10.1145/3381449), published in the ACM Transactions on Mathematical Software, provides an in-depth look at the design of JGraphT, and also includes performance comparisons against other libraries.
## **21-Feb-2020:** Release 1.4.0 is now available!
### Read the [release announcement](https://sourceforge.net/p/jgrapht/news/2020/02/jgrapht-version-140-released/) for more info.
jgrapht-jgrapht-1.5.2/docs/_posts/2000-01-07-ack.md 0000664 0000000 0000000 00000003412 14424254415 0021160 0 ustar 00root root 0000000 0000000 ---
title: "Thanks"
bg: lavender
fa-icon: heart
color: black
style: center
---
The JGraphT team is grateful to all of our [contributors](https://github.com/jgrapht/jgrapht/blob/master/CONTRIBUTORS.md) over the years for making the project what it is today!
JGraphT is dual-licensed under [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) and [EPL 2.0](https://www.eclipse.org/legal/epl-2.0/). As a recipient of JGraphT, you may choose which license to receive the code under. Licensing information for libraries on which the project depends is available in the [README](https://github.com/jgrapht/jgrapht#dependencies).
Project development takes place on [github](https://github.com/jgrapht/jgrapht), but we still make use of [sourceforge](https://sourceforge.net/projects/jgrapht) for some resources as well.
This website is built using
[Jekyll](https://github.com/jekyll/jekyll), with help from the
[SinglePaged theme](https://github.com/t413/SinglePaged) and the [Primer theme](https://github.com/pages-themes/primer).
If you enjoy using JGraphT, show us by clicking the **Like** button for
our [Facebook page](https://www.facebook.com/jgrapht)!
jgrapht-jgrapht-1.5.2/docs/combo.css 0000664 0000000 0000000 00000000135 14424254415 0017360 0 ustar 00root root 0000000 0000000 ---
---
{% include css/base.css %}
{% include css/skeleton.css %}
{% include css/main.css %}
jgrapht-jgrapht-1.5.2/docs/guide-templates/ 0000775 0000000 0000000 00000000000 14424254415 0020641 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/docs/guide-templates/GuavaAdapter.md 0000664 0000000 0000000 00000003256 14424254415 0023535 0 ustar 00root root 0000000 0000000 ---
title: Guava Graph Adapter
---
# {{ page.title }}
If you are using [Guava's common.graph data structure](https://github.com/google/guava/wiki/GraphsExplained), and would like to take advantage of an algorithm implemented by JGraphT, it's quite straightforward to do this via the adapters supplied by JGraphT.
For example, suppose you've created a Guava graph as follows:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-guava/src/test/java/org/jgrapht/graph/guava/MutableGraphAdapterTest.java?example=createGuavaGraph)
```
The graph does not have any information associated with the edges, so we can use JGraphT's [MutableGraphAdapter](https://jgrapht.org/javadoc/org.jgrapht.guava/org/jgrapht/graph/guava/MutableGraphAdapter.html) to view it in JGraphT:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-guava/src/test/java/org/jgrapht/graph/guava/MutableGraphAdapterTest.java?example=adaptGuavaGraph)
```
Now suppose we want to find a [minimum vertex cover](https://brilliant.org/wiki/vertex-cover) for this graph. JGraphT supplies [several algorithms](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/alg/vertexcover/package-summary.html) for this purpose:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-guava/src/test/java/org/jgrapht/graph/guava/MutableGraphAdapterTest.java?example=findVertexCover)
```
Since the result is just a set of strings, it can be used to directly reference the JGraphT view as well as the underlying Guava graph.
For more information on the available adapters, please see the [org.jgrapht.graph.guava javadoc](https://jgrapht.org/javadoc/org.jgrapht.guava/org/jgrapht/graph/guava/package-summary.html).
jgrapht-jgrapht-1.5.2/docs/guide-templates/HelloJGraphT.md 0000664 0000000 0000000 00000000300 14424254415 0023437 0 ustar 00root root 0000000 0000000 ---
title: Hello JGraphT Complete Example
---
# {{ page.title }}
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java)
```
jgrapht-jgrapht-1.5.2/docs/guide-templates/LabeledEdges.md 0000664 0000000 0000000 00000004271 14424254415 0023467 0 ustar 00root root 0000000 0000000 ---
title: Labeled Edges
---
# {{ page.title }}
A common requirement for JGraphT applications is the need to associate a label
with each edge. This can be accomplished efficiently via a custom edge class:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/LabeledEdges.java?example=edgeclass)
```
JGraphT's default graph and edge implementations take care of
maintaining the connectivity information between vertices, so the
custom edge subclass only needs to store the label. Since the custom
edge class does not override `equals`/`hashCode`, each edge object is
distinct from every other edge object (regardless of whether they
share the same label). Consequently, labels do not have to be
unique within the same graph.
As defined above, `RelationshipEdge` could be used in either a
directed or undirected graph. In the example below, we apply it to a
a backstabby form of non-symmetric friendship via a directed graph:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/LabeledEdges.java?example=create)
```
Since the `RelationshipEdge` class does not have a default constructor, edges
must be explicitly instantiated and added via [addEdge(V,V,E)](http://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#addEdge-V-V-E-) rather than implicitly instantiated via
[addEdge(V,V)](http://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#addEdge-V-V-).
Once the graph has been populated, label information can be accessed during traversal:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/LabeledEdges.java?example=print)
```
Given two vertices, an application can check the label on the edge between them by using [getEdge(V,V)](http://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#getEdge-V-V-):
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/LabeledEdges.java?example=isEnemyOf)
```
You can find the complete source code for this example at [LabeledEdge.java](https://github.com/jgrapht/jgrapht/blob/master/jgrapht-demo/src/main/java/org/jgrapht/demo/LabeledEdges.java)
jgrapht-jgrapht-1.5.2/docs/guide-templates/Sux4JImplementations.md 0000664 0000000 0000000 00000006625 14424254415 0025242 0 ustar 00root root 0000000 0000000 ---
title: Sux4J-Based Implementations
---
# {{ page.title }}
[Sux4J](https://sux4j.di.unimi.it/) is a library containing
implementations of [succinct data structures](https://en.wikipedia.org/wiki/Succinct_data_structure)
in Java. Such structures can be used to store graphs in a very compact form. For example,
the memory footprint of the [English Wikipedia graph in 2013](http://law.di.unimi.it/webdata/enwiki-2013/)
would be a few gigabytes in a trivial object-based representation, it is 1.6GB in JGraphT's
[sparse representation](https://jgrapht.org/javadoc/org.jgrapht.opt/org/jgrapht/opt/graph/sparse/SparseIntDirectedGraph.html),
but it is just 500MB in a succinct representation. The denser the graph, the more
marked these differences will be.
The implementations in the package
[org.jgrapht.sux4j](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/package-summary.html)
make it possible to use succinct representation of graphs in JGraphT.
The implementations are serializable, and you can download ready-made
graphs in this form from the [LAW web site](http://law.di.unimi.it/datasets.php).
The typical use case for these adapters is:
- You need a compact format.
- You have less than 231 vertices and less than 231 edges.
- You have metadata associated with the vertices and with the edges.
- Optionally, you need fast [adjacency tests](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#containsEdge%28V,V%29).
Such metadata can be easily stored in an array or list indexed by the vertices or
the edges. If you have metadata on the vertices only, or if your number
of vertices or edges does not satisfy the limitations above, a [WebGraph
adapter](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/webgraph/package-summary.html)
might be more appropriate. A separate [guide](WebGraphAdapters) is available for
WebGraph adapters.
The two main implementations are [`SuccinctDirectedGraph`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/SuccinctDirectedGraph.html)
and [`SuccinctUndirectedGraph`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/SuccinctUndirectedGraph.html).
They both use pairs to represent edges, but you can easily [map edges](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/SuccinctDirectedGraph.html#getEdgeFromIndex%28long%29)
in a contiguous segment of integers starting from zero; the mapping is reasonably fast.
Note that one of the benefits of the succinct representation used by these classes is that
[adjacency tests](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#containsEdge%28V,V%29) are very fast.
If you need, however, an implementation whose vertex and edge type is
`Integer` (for example, for usage with [Python
bindings](https://pypi.org/project/jgrapht/)), there are classes
[`SuccinctIntDirectedGraph`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/SuccinctIntDirectedGraph.html)
and
[`SuccinctIntUndirectedGraph`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/SuccinctIntUndirectedGraph.html).
These classes, however, are fairly slow due to the necessity of
continuously remapping edges from pairs to indices. We suggest that you use them
only in the directed case and for outgoing arcs. However, in some cases
they might provide the only representation of this type that is small
enough to be loaded in main memory.
jgrapht-jgrapht-1.5.2/docs/guide-templates/UserOverview.md 0000664 0000000 0000000 00000060210 14424254415 0023627 0 ustar 00root root 0000000 0000000 ---
title: Overview for Application Developers
---
# {{ page.title }}
{:.no_toc}
This overview will help get you started with using the JGraphT library in
your own applications. We'll cover the following topics:
1. Table of contents
{:toc}
## Development Setup
First, [set up your development environment](https://github.com/jgrapht/jgrapht/wiki/Users:-How-to-use-JGraphT-as-a-dependency-in-your-projects) with JGraphT as a dependency.
## Hello JGraphT
In JGraphT, a graph is defined as a set of vertices connected by a set
of edges. Many possible variations on this fundamental definition are
supported, as we'll explain further on; but for now, let's take a look
at a simple example of creating a directed graph:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java?example=uriCreate)
```
Notice how the vertex objects are instances of the
[java.net.URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html)
class. JGraphT does not supply a vertex class itself; instead, you're
free to choose your own based on whatever works best for your
application, subject to certain restrictions mentioned below.
You are also free to choose your own edge class. If you don't need to
associate any application-specific information with your edges, you
can just use the library-supplied
[DefaultEdge](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/DefaultEdge.html)
as in this example. The graph constructor takes the edge class as a
parameter so that it can create new edge objects implicitly whenever
`addEdge` is called to connect two vertices.
## Choosing Vertex and Edge Types
There are a number of restrictions to be aware of when choosing custom
vertex and edge types, mostly regarding override of the
`equals`/`hashCode` methods; be sure to read through
[this overview](VertexAndEdgeTypes).
## Graph Accessors
Once a graph has been created, an application can access its vertices
and edges directly via live set views:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java?example=findVertex)
```
Here we iterate over all vertices of the graph via the [vertexSet](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#vertexSet--) method, filtering for only those
whose URL has `www.jgrapht.org` for its hostname; in our example, we can
expect to find exactly one match, which we obtain via `findAny().get()`.
Given a reference to a vertex or edge, we can find connections via
`Graph` methods such as `getEdgeSource`, `getEdgeTarget`, `edgesOf`,
`incomingEdgesOf`, and `outgoingEdgesOf`. Given a pair of vertices,
we can find the edge(s) connecting them via `getEdge` and
`getAllEdges`. Here, collection-returning methods should not to be
assumed to be live views (although they may be for some graph
implementations). In some cases, the returned collections may be
unmodifiable, while in others they may consist of transient results.
In no case should an application expect modifications to the returned
collection to result in modifications to the underyling graph.
The [Graphs](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html)
utility class has additional convenience methods such as
[successorListOf](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html#successorListOf-org.jgrapht.Graph-V-)
and
[getOppositeVertex](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html#getOppositeVertex-org.jgrapht.Graph-E-V-)
for easing common access patterns.
Note that the default graph implementations guarantee predictable
ordering for the collections that they maintain; so, for example, if
you add vertices in the order `[B, A, C]`, you can expect to see them in
that order when iterating over the vertex set. However, this is not a
requirement of the `Graph` interface, so other graph implementations
are not guaranteed to honor it.
## Graph Structures
Besides choosing your vertex and edge classes, JGraphT also allows you
to choose a graph structure. One way to do so is by instantiating a
concrete class which implements the
[Graph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html) interface,
as with `DefaultDirectedGraph` in the example above. When doing so,
you can make your selection from the table below (or from your own
subclasses of any of these).
| Class Name | Edges | Self-loops | Multiple edges | Weighted |
|:----------------------------:|:--------:|:----------:|:--------------:|:--------:|
|SimpleGraph |undirected|no | no |no |
|Multigraph |undirected|no | yes |no |
|Pseudograph |undirected|yes | yes |no |
|DefaultUndirectedGraph |undirected|yes | no |no |
|SimpleWeightedGraph |undirected|no | no |yes |
|WeightedMultigraph |undirected|no | yes |yes |
|WeightedPseudograph |undirected|yes | yes |yes |
|DefaultUndirectedWeightedGraph|undirected|yes | no |yes |
|SimpleDirectedGraph |directed |no | no |no |
|DirectedMultigraph |directed |no | yes |no |
|DirectedPseudograph |directed |yes | yes |no |
|DefaultDirectedGraph |directed |yes | no |no |
|SimpleDirectedWeightedGraph |directed |no | no |yes |
|DirectedWeightedMultigraph |directed |no | yes |yes |
|DirectedWeightedPseudograph |directed |yes | yes |yes |
|DefaultDirectedWeightedGraph |directed |yes | no |yes |
The structural properties are as follows:
* undirected edges: an edge simply connects a vertex pair, without imposing a direction
* directed edges: an edge has a source and a target
* self-loops: whether to allow edges which connect a vertex to itself
* multiple edges: whether to allow more than one edge between the same vertex pair (note that in a directed graph, two edges between the same vertex pair but with opposite direction do not count as multiple edges)
* weighted: whether a double weight is associated with each edge (for these graph types, you'll usually want to use [DefaultWeightedEdge](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/DefaultWeightedEdge.html) as your edge class); unweighted graphs are treated as if they have a uniform edge weight of 1.0, which allows them to be used in algorithms such as finding a shortest path
The [GraphType](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/GraphType.html)
interface allows you to access this metadata for an existing graph
instance (using the
[getType](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#getType--)
accessor).
You can also use [GraphTypeBuilder](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/builder/GraphTypeBuilder.html) to instantiate a new graph without directly constructing a concrete class:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/GraphBuilderDemo.java?example=buildType)
```
`GraphTypeBuilder` uses the property values you supply in order to
automatically choose the correct concrete class for you. This is
generally a cleaner pattern to follow, but it's not applicable if you
end up needing to subclass one of the provided graph classes.
## Graph Modification
Earlier, we saw how to add vertices and edges to a new graph by
calling the
[addVertex](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#addVertex-V-)
and
[addEdge](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#addEdge-V-V-)
methods on the `Graph` interface. Likewise, there are corresponding
methods for removing graph components. All of these methods are
modeled on the `java.util` collections framework, so:
* adding a duplicate object to a set (e.g. when adding a vertex) is not an error, but the duplicate is discarded
* adding a duplicate object to a non-unique collection (e.g. when adding an edge to a multigraph) inserts the new instance
* attempting to remove an object which was not part of the graph is not an error
* but _attempting to access attributes of an object which is not part of the graph_ is strictly forbidden, and results in an `IllegalArgumentException` (e.g. when you ask for the edges of a vertex, but the vertex is not currently part of the graph)
The strictness enforcement mentioned above is the default in order to
help catch application errors. There are two convenience helpers
available to assist with this when adding components to a graph; both
of them take care of automatically adding vertices whenever edges are
added:
* The [Graphs](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html) utility class provides methods such as [addEdgeWithVertices](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html#addEdgeWithVertices-org.jgrapht.Graph-V-V-)
* The [GraphBuilder](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/builder/AbstractGraphBuilder.html) framework also allows you to use [method chaining](https://en.wikipedia.org/wiki/Method_chaining) when populating data in a new graph.
Here's an example using `GraphBuilder` to construct a
[kite graph](http://mathworld.wolfram.com/KiteGraph.html):
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/GraphBuilderDemo.java?example=buildEdges)
```
The integer vertex objects are added to the graph implicitly as the
referencing edges are added. Note that building the graph proceeds in
two phases; first `buildEmptySimpleGraph` builds an empty graph
instance for the specified graph type, then `GraphBuilder` takes over
for populating the vertices and edges.
### Vertex and Edge Suppliers
JGraphT optionally allows you to provide a graph with vertex and edge
suppliers. When these are available, the graph will automatically
construct a new object instance whenever one is not explicitly
supplied by the corresponding `add` method.
### Modification Listeners
JGrapht provides a framework for reacting to graph modifications via
the
[ListenableGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/ListenableGraph.html)
interface. By default, graph instances are not listenable for
efficiency; here's how to use the framework:
* wrap your graph instance via [DefaultListenableGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/DefaultListenableGraph.html)
* perform all modifications on the wrapper (not the underlying graph instance)
* register one or more [GraphListener](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/event/GraphListener.html) to react to modification events
This can be a convenient way to keep other data structures or
visualizations in sync with graph changes. For example, suppose your
graph represents a CAD model being visualized; then every time the
graph is edited, all affected views can be automatically refreshed
from listener events.
### Concurrency
The default graph implementations are not safe for concurrent reads
and writes from different threads. If an application attempts to
modify a graph in one thread while another thread is reading or
writing the same graph, undefined behavior will result. However,
concurrent reads against the same graph from different threads are
safe. (Note that the Graph interface itself makes no such guarantee,
so for non-default implementations, different rules may apply.)
If you need support for concurrent reads and writes, consider using
the
[AsSynchronizedGraph wrapper](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/concurrent/AsSynchronizedGraph.html).
## Graph Generation
Besides constructing vertices and edges individually, applications can
also generate graph instances according to predefined patterns. This
is often useful for generating test cases or default topologies.
JGraphT provides a number of different generators for this purpose in
the
[org.jgrapht.generate](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/generate/package-summary.html)
package. Here's an example of generating a [complete graph](http://mathworld.wolfram.com/CompleteGraph.html):
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/CompleteGraphDemo.java?example=class)
```
The `SIZE` parameter controls the number of vertices added to the
graph (which in turn dictates the number of edges added).
## Graph Traversal
Once you've created a graph, you can traverse it using an ordering
such as depth-first, breadth-first, or topological. JGraphT provides
for this via package
[org.jgrapht.traverse](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/traverse/package-summary.html).
The common interface is
[GraphIterator](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/traverse/GraphIterator.html),
which specializes the generic Java `Iterator` interface with JGraphT
specifics. A graph iterator produces vertices in the requested order;
as the iteration proceeds, additional information (such as when a
particular edge is traversed) can be obtained by registering a
[TraversalListener](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/event/TraversalListener.html).
(The specific meaning of traversal events varies with the iterator
type.)
Here's an example using depth-first ordering on our HelloJGraphT example:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java?example=traverse)
```
with expected output
```
http://www.jgrapht.org
http://www.wikipedia.org
http://www.google.com
```
In this example, no extra information is required during the
traversal, so it is treated as a standard Java `Iterator`.
## Graph Algorithms
Beyond basic traversals, you'll often want to run more complex algorithms on
a graph. JGraphT provides quite a few of these, so they are subcategorized
under the
[org.jgrapht.alg parent package](https://jgrapht.org/javadoc/org.jgrapht.core/module-summary.html).
For example, various shortest path algorithms are implemented in
[org.jgrapht.alg.shortestpath](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/alg/shortestpath/package-summary.html).
In cases where there are alternative algorithms available for the same
problem, the commonality is abstracted via an interface in
[org.jgrapht.alg.interfaces](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/alg/interfaces/package-summary.html).
This makes it easier to write application code which selects an
optimal algorithm implementation for a given graph instance.
Here's an example of running [strongly connected components](http://mathworld.wolfram.com/StronglyConnectedComponent.html) and shortest path algorithms on a directed graph:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/DirectedGraphDemo.java?example=main)
```
with expected output
```
Strongly connected components:
([i], [])
([h], [])
([e, f, g], [(e,f), (f,g), (g,e)])
([a, b, c, d], [(a,b), (b,d), (d,c), (c,a)])
Shortest path from i to c:
[(i : h), (h : e), (e : d), (d : c)]
Shortest path from c to i:
null
```
## Graph Serialization and Export/Import
The default graph implementations provided by JGraphT are
[serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)
as long as you choose vertex and edge types which are themselves
serializable.
Serialization is a convenient way to store a graph instance as binary
data, but the format is not human-readable, and we don't make any
guarantee of serialization compatibility across JGraphT versions. (In
other words, if you serialize a graph with version X, and then attempt
to deserialize it with version X+1, an exception may be thrown.)
To address this, JGraphT provides module
[org.jgrapht.io](https://jgrapht.org/javadoc/org.jgrapht.io/module-summary.html)
for exporting and importing graphs in a variety of standard formats.
These can also be used for data interchange with other applications.
Continuing our HelloJGraphT example, here's how to export a graph in [GraphViz .dot](https://www.graphviz.org/) format:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java?example=render)
```
with expected output
```
strict digraph G {
www_google_com [ label="http://www.google.com" ];
www_wikipedia_org [ label="http://www.wikipedia.org" ];
www_jgrapht_org [ label="http://www.jgrapht.org" ];
www_jgrapht_org -> www_wikipedia_org;
www_google_com -> www_jgrapht_org;
www_google_com -> www_wikipedia_org;
www_wikipedia_org -> www_google_com;
}
```
which GraphViz renders as:

If you just want a quick dump of the structure of a small graph, you
can also use the `toString` method; here's another example from the HelloJGraphT demo:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java?example=toString)
```
which produces
```
([v1, v2, v3, v4], [{v1,v2}, {v2,v3}, {v3,v4}, {v4,v1}])
```
First comes the vertex set, followed by the edge set. Directed edges
are rendered with round brackets, whereas undirected edges are
rendered with curly brackets. Custom edge attributes are not
rendered. If you want a nicer rendering, you can override
[toStringFromSets](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AbstractGraph.html#toStringFromSets-java.util.Collection-java.util.Collection-boolean-)
in your graph implementation, but you're probably better off using one
of the exporters instead.
## Graph Cloning
The `Graph` interface does not expose a public `clone` method, because
we do not require all implementations to be cloneable. However, all
subclasses of
[AbstractBaseGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AbstractBaseGraph.html)
are cloneable. The clone semantics are shallow in that the same vertex
and edge objects are shared between the original graph and the clone;
however, the vertex and edge sets and all associated connectivity
structures are copied, not shared, so that the two graphs are otherwise
independent.
## Graph Comparisons
The default JGraphT implementations of the `Graph` interface override `equals`/`hashCode`, so it's possible to use them to compare two graph instances. However, it's important to note that the definition of equality used may not be the one you are expecting. Here are the rules used:
* the two graph instances must be of identical concrete class (e.g. `DefaultDirectedGraph`)
* the vertex sets of the two graph instances must be equal (using the definition from [java.util.Set](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html#equals(java.lang.Object)), and taking into account the `equals` implementation of the vertex type you've chosen)
* the edges sets of the two graph instances must be equal (again using the `java.util.Set` definition, and taking into account the `equals` implementation of the edge type you've chosen)
* for a given edge, the source/target/weight must be equal in both graph instances (for undirected graphs, the source/target distinction is ignored)
In general, an exact copy of a graph object via `Graphs.addGraph` or
`clone` will be equal to the original according to this definition
(assuming the same concrete class is chosen for the copy). However,
for copy via serialization followed by deserialization, this won't
hold unless both the vertex and edge classes override `equals`/`hashCode`.
If you were expecting a structural comparison instead, then you might
want to investigate the
[isomorphism](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/alg/isomorphism/package-summary.html)
package. In the unrestricted case, isomorphism detection can take
exponential time, but it can be speeded up significantly if you're
able to guide it with a labeling. For example, suppose you have two
graphs with anonymous edges, but the vertex set is the same, and you
want to decide whether the graphs are effectively equal. In that case, you can run an
isomorphism inspector with a comparator specified for the vertices.
Then JGraphT can tell you whether the two graphs are structurally
equivalent (and if so, provide a mapping between the edge objects).
## Graph Wrappers
Besides core graph data structures, JGraphT also provides a number of useful wrappers which allow you to define live _transformed_ views into other graphs:
* [AsGraphUnion](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsGraphUnion.html): a union of two underlying graphs
* [AsSubgraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsSubgraph.html): a subgraph (possibly induced) of an underlying graph
* [AsUndirectedGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsUndirectedGraph.html): an undirected view of an underlying directed graph (with edge directions ignored)
* [AsUnmodifiableGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsUnmodifiableGraph.html): an unmodifiable view of an underlying graph
* [AsUnweightedGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsUnweightedGraph.html): an unweighted view of a underlying weighted graph (ignoring all edge weights and treating them as 1.0 instead)
* [AsWeightedGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/AsWeightedGraph.html): a weighted view of an underlying unweighted graph (with edge-specific weights imposed via a map)
* [EdgeReversedGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/graph/EdgeReversedGraph.html): an edge-reversed view of a directed graph
Wrappers add some access cost, so if you don't need a live view, and you will be accessing the transformed results heavily, then you can copy the view to a snapshot using [Graphs.addGraph](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graphs.html#addGraph-org.jgrapht.Graph-org.jgrapht.Graph-).
## Graph Adapters
### Guava Graph Adapter
If you are already using
[com.google.common.graph](https://google.github.io/guava/releases/snapshot/api/docs/com/google/common/graph/package-summary.html)
for representing graphs, it's easy to interoperate with JGraphT by
using our
[adapter package](https://jgrapht.org/javadoc/org.jgrapht.guava/org/jgrapht/graph/guava/package-summary.html).
Simply instantiate the correct adapter on top of your Guava graph, and
you'll have an implementation of JGraphT's `Graph` interface which
stays in sync with the Guava graph automatically, at no extra memory
cost. Now you can [run JGraphT algorithms](GuavaAdapter) on top of your Guava graph,
or run our importers or exporters against it.
### Adapters for Very Large Graphs
If you are trying to run algorithms over very large graphs, the
default JGraphT representations may eat up too much of your main
memory. Instead, you can use the adapters provided for
[WebGraph](WebGraphAdapters) or
[succinct graphs](Sux4JImplementations) (via Sux4J).
### JGraphX Adapter
JGraphT also provides an adapter that lets you use a JGraphT graph
instance as the data model for a
[JGraphX](https://jgraph.github.io/mxgraph/docs/manual_javavis.html)
visualization. All you need to do is wrap your JGraphT graph with
[org.jgrapht.ext.JGraphXAdapter](https://jgrapht.org/javadoc/org.jgrapht.ext/org/jgrapht/ext/JGraphXAdapter.html) as in the following example:
```java
:[source code](http://code.jgrapht.org/raw/master/jgrapht-demo/src/main/java/org/jgrapht/demo/JGraphXAdapterDemo.java?example=full)
```
## Running Demos
If you want to run the demo programs excerpted throughout this
overview, see
[these instructions](https://github.com/jgrapht/jgrapht/wiki/Users:-Running-JGraphT-demos).
You can also find the full source code in
[github](https://github.com/jgrapht/jgrapht/tree/master/jgrapht-demo/src/main/java/org/jgrapht/demo).
## Browsing Unit Tests
Another good way to learn how to use the various classes provided by
JGraphT is to study their usage in unit tests. Here's the source code
of
[tests for the core classes](https://github.com/jgrapht/jgrapht/tree/master/jgrapht-core/src/test/java/org/jgrapht).
jgrapht-jgrapht-1.5.2/docs/guide-templates/VertexAndEdgeTypes.md 0000664 0000000 0000000 00000031103 14424254415 0024673 0 ustar 00root root 0000000 0000000 ---
title: Vertex and Edge Types
---
# {{ page.title }}
{:.no_toc}
When constructing a JGraphT graph, it's important to select the vertex
and edge types carefully in order to ensure correct behavior while
satisfying application requirements. This page walks through a number
of variations based on common application use cases:
1. Table of contents
{:toc}
## equals and hashCode
Vertex and edge objects are used as keys inside of the default graph
implementation, so when choosing their types, you must follow these
rules:
* You must follow the contract defined in `java.lang.Object` for both [equals](https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)) and [hashCode](https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()).
* In particular, if you override either `equals` or `hashCode`, you must override them both
* Your implementation for `hashCode` must produce a value which does not change over the lifetime of the object
[This article](https://www.ibm.com/developerworks/java/library/j-jtp05273/index.html) explains some of the nuances.
Additional guidelines are provided in the scenario-specific sections below.
## Anonymous Vertices
Applications interested only in graph structure (e.g. graph theory
research) may want to save memory by keeping vertices as minimalist as
possible. In this case, just use
[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html)
as the vertex type. In this case, the vertex `hashCode` may serve as
a "nearly" unique identifier during debugging.
## Vertices as Key Values
More common is for each vertex to represent a key value, as in the
[HelloJGraphT](UserOverview#hello-jgrapht) example (where each vertex
corresponds to a website identified by a URL). For this use case, a
`String`, `Integer`, or similar class is a good choice for vertex
type. In this case, it's important to note that the value must be
unique within the graph. In other words, for a vertex of type
`String`, the `String` value is an _identifier_, not a mere _label_.
## Vertices with Attributes
More sophisticated applications may need to associate non-key
attributes (possibly multiple) with each vertex. The obvious way to
do this is with a class that stores the attributes, but there are a
few different cases to consider.
### No keys
If all attributes on the vertex are non-key, then the approach is
straightforward. For example, suppose you are modeling molecular
structures, where the vertices are atoms and the edges are the bonds
between them. Then you might define a class
```java
class AtomVertex
{
Element element; // using enum of the periodic table
int formalCharge; // for bookkeeping purposes
... other atomic properties ...
}
```
In this case, you should **not** override `equals` and `hashCode`,
since there may be many distinct atoms with the exact same properties.
### All keys
Conversely, if all attributes are components of a key, then the
approach is also simple. Suppose your application is a software
package manager, and each vertex in your graph corresponds to a
package, with edges representing package dependencies. Then you might
define a class like
```java
class SoftwarePackageVertex
{
final String orgName;
final String packageName;
final String packageVersion;
... constructor etc ...
public String toString()
{
return orgName + "-" + packageName + "-" + packageVersion;
}
public int hashCode()
{
return toString().hashCode();
}
public boolean equals(Object o)
{
return (o instanceof SoftwarePackageVertex) && (toString().equals(o.toString()));
}
}
```
Here, you almost certainly **do** want to override `equals` and
`hashCode`, since there should not be more than one vertex object
representing the same package version. And you'll be able to access
an existing vertex in a graph just by constructing it, without having
to iterate over all vertices in the graph to find it.
Note that the fields are declared final; this is important since
vertices and edges are used as hash keys, meaning their hash codes
must never change after construction.
### Key subset
Now we come to the problematic case. Continuing the previous example,
suppose you want to add a `releaseDate` field to
`SoftwarePackageVertex` in order to track when the package version was
released. This new field is not part of the key; it's just data. But
what do we do about `equals`/`hashCode`?
* It's not a good idea to incorporate `releaseDate` into them for a number of reasons. For example, if we want to reference the vertex for a package by its identifier, but we don't know its release date, how do we find the vertex? And what if the release date changes for an unreleased package? How do we avoid two distinct vertex objects representing the same package version?
* However, if we don't incorporate `releaseDate` into `equals`/`hashCode`, then we could end up with inconsistencies due to two vertex objects with different `releaseDate` values being treated as equivalent.
So if you try to implement this case, beware that you're likely to run into unforeseen pitfalls.
## Vertices as Pointers
A more flexible way to handle the situation above is to make the
vertex refer to an external object rather than containing data itself.
For the example above, the vertex type could be
`SoftwarePackageVertex` as originally defined, without the release
date. Then additional information such as the release date would be
stored via a separate `SoftwarePackageVersion` class, with a map keyed
on `SoftwarePackageVertex` for lookups. This keeps the graph
representation clear, but adds some lookup cost.
An optimization is to implement the vertex as a direct reference:
```java
class SoftwarePackageVertex
{
final SoftwarePackageVersion version;
public String toString()
{
return version.keyString();
}
public int hashCode()
{
return toString().hashCode();
}
public boolean equals(Object o)
{
return (o instanceof SoftwarePackageVertex) && (toString().equals(o.toString()));
}
}
class SoftwarePackageVersion
{
final String orgName;
final String packageName;
final String packageVersion;
Date releaseDate;
public String keyString()
{
return orgName + "-" + packageName + "-" + packageVersion;
}
}
```
This way, we can construct a vertex from a package version at any
time, and given a vertex, we can directly access package version
information without any map lookup required. The application is still
responsible for avoiding inconsistencies due to the existence of
multiple SoftwarePackageVersion objects with the same key, but now
that responsibility is separate from the graph representation.
## Anonymous Edges
Now let's move on to edge types. The most common case is that there
is no information associated with an edge other than its connectivity.
Generally, you can use the `DefaultEdge` class provided by JGraphT for
this and not think about it any further. However, there is one point
you should be aware of:
* JGraphT optimizes `DefaultEdge`-based graphs by using an intrusive technique in which the connectivity information is stored inside the edge object itself (rather than inside the graph).
As a result, if you need to add the same edge object to two different
graphs, then those graphs must have the same vertex connections for
that edge, otherwise undefined behavior will result. If this (rare)
case applies to your application, then instead of using `DefaultEdge`,
just use `java.lang.Object` as your edge type. Note that this adds a
map lookup penalty to connectivity accessor methods.
It's common in JGraphT for edge objects to be reused across graphs;
for example, an algorithm may return a subgraph of the input graph as
its result, and the subgraph will reuse subsets of the input graph's
vertex and edge sets. In these cases, the connectivity equivalence is
valid (or if it's not, the algorithm avoids reuse).
## Weighted Edges
Another common case is for each edge to bear a double-valued weight as
its only attribute (e.g. a physical network with latency measured for
each link). For this case, JGraphT supplies the `DefaultWeightedEdge`
class, which extends the optimization mentioned in the previous
section by storing the weight directly on the edge object.
The same caveats apply, with the additional restriction that if a
`DefaultWeightedEdge` is reused in another graph, it will have the
same weight in both graphs. Again, if this presents a problem, then
use `java.lang.Object` as your edge class instead.
## Edges as Key Values
Sometimes, applications may be able to associate a unique key value
with each edge. For example, consider a graph representing money
transfers between bank accounts, where the vertices represent the
accounts and the edges represent the transfers. In this case, the
application could use a `String` containing the transfer transaction
ID as the edge type.
* _NOTE:_ Although correct, this implementation may not be optimal, since it loses the connectivity optimization described for `DefaultEdge` above.
However, it would definitely be **incorrect** to use the transaction
amount as the edge type, since this is not unique across the entire
graph. (A weighted edge could instead be used for this purpose.)
## Edges with Attributes
For edges with multiple attributes or non-key attributes, the same
considerations as those
[given previously for vertices](#vertices-with-attributes) apply. In
addition, when defining a class which will be used as an edge type,
applications will typically want to subclass either `DefaultEdge` or
`DefaultWeightedEdge` (subject to the caveats already mentioned).
Those base classes do not override `equals`/`hashCode`, but
applications are free to do so in subclasses as appropriate.
Note that when overriding `equals`/`hashCode` for an edge class, it is
incorrect to incorporate the edge source/target into the operations;
the edge identity is always independent of its connectivity.
For an example of how to apply a `String` attribute as a non-key label
on each edge, see [the LabeledEdges demo](LabeledEdges.md). JGraphT
does not provide a labeled edge class since there are many different
ways to implement this pattern.
## Vertices and Edges as External Objects
In some cases, an application may want to use existing complex objects
as vertex and/or edge types directly. For example, consider an
application in which the graph is used in a manager thread to optimize
concurrent dataflow, with each vertex representing a worker thread and
each edge representing a dataflow producer/consumer queue. In this
case, it would be OK to use
[java.lang.Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html)
for the vertex type and
[LinkedBlockingDeque](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/LinkedBlockingDeque.html)
for the edge type (since these classes do no override
`equals`/`hashCode`).
However, if the queue implementation were such that it allowed two
queue instances to be compared for value-equality via `equals`, then this
would **not** be a good choice for edge type. In this case, it would
be necessary to wrap the queue in a custom edge class which references
it,
[similar to what was described for vertices above](#vertices-as-pointers).
## Labeled Edges in a Multigraph
This is one case for which JGraphT does not currently support a 100%
efficient implementation. Suppose we want to represent a
[finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine)
using a pseudograph (allowing both self-loops and multiple edges
between vertices). Vertices will represent states, and edges
will represent transitions. For the vertex type, we might choose
`String`, but for the edge type, we can't use `String` since
transition names are not unique across the entire graph; they are only
unique within the subset of edges between a given pair of vertices.
Instead, we can use a labeled edge class as
[described above](#edges-with-attributes). However, suppose we want
to find an existing edge given a pair of vertices and a transition
name. This requires invoking
[getAllEdges](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#getAllEdges-V-V-)
for the vertex pair and then searching through the result, filtering
by transition name. If many transitions are defined, this may become
slow.
It would be nice if there were a faster solution for this problem,
especially since the graph's edge set already provides an index into
all edges in the graph. There are kludgy ways to accomplish a
constant time lookup, but we don't recommend them, so we won't go into
them here.
jgrapht-jgrapht-1.5.2/docs/guide-templates/WebGraphAdapters.md 0000664 0000000 0000000 00000006751 14424254415 0024357 0 ustar 00root root 0000000 0000000 ---
title: WebGraph Adapters
---
# {{ page.title }}
[WebGraph](https://webgraph.di.unimi.it/) is a framework for storing and
accessing graphs (and in particular web graphs) in a compressed form,
making it possible to load and access very large graphs with a moderate
amount of memory. You can download ready-made graphs in this form from the
[LAW web site](http://law.di.unimi.it/datasets.php), or compress your own
graphs using the instructions provided in the [package overview](https://webgraph.di.unimi.it/docs/).
For example, the memory footprint of a [snapshot of web sites from Indochina in 2004](http://law.di.unimi.it/webdata/indochina-2004/)
with 200 million edges would be a few gigabytes in a trivial representation, it is 260MB in JGraphT's
[sparse representation](https://jgrapht.org/javadoc/org.jgrapht.opt/org/jgrapht/opt/graph/sparse/SparseIntDirectedGraph.html),
but it is just 59MB in WebGraph.
The adapters in the package
[org.jgrapht.webgraph](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/webgraph/package-summary.html)
make it possible to use graphs in WebGraph format in JGraphT.
The typical use case for these adapters is:
- You need a compact format (vertices will be just contiguous integers starting from zero).
- The type of graph you are storing is compressible.
- You have metadata associated with the vertices, but not with the arcs.
Such metadata can be easily stored in an array indexed by the vertices,
or possibly by a [`fastutil` big array](https://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/BigArrays.html)
if you have more than 231 vertices (lists and [big lists](https://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/BigList.html) are another option).
If you need to associate metadata with the arcs, and manage the graph in a
compact format, a succinct representation from the package
[org.jgrapht.sux4j](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/sux4j/package-summary.html)
might be more appropriate, as those representation associate with
each edge an integer in a contiguous range starting from zero.
A separate [guide](Sux4JImplementations) is available for
succinct graph adapters.
WebGraph has two versions: the standard version manages graph with
at most 231 vertices, whereas the big version manages graphs with
at most 263 vertices. For each version, there is a directed
adapter and an undirected adapter. The Javadoc documentation of
[`ImmutableDirectedGraphAdapter`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/webgraph/ImmutableDirectedGraphAdapter.html)
and [`ImmutableUndirectedGraphAdapter`](https://jgrapht.org/javadoc/org.jgrapht.unimi.dsi/org/jgrapht/webgraph/ImmutableUndirectedGraphAdapter.html)
contain examples of how to load graphs in webgraph and use them
to build an adapter. The big adapters work in the same way.
Note that WebGraph has two main representations:
[`BVGraph`](https://webgraph.di.unimi.it/docs/it/unimi/dsi/webgraph/BVGraph.html)
uses compression techniques that work well with web graphs;
[`EFGraph`](https://webgraph.di.unimi.it/docs/it/unimi/dsi/webgraph/EFGraph.html)
uses [succinct techniques](https://en.wikipedia.org/wiki/Succinct_data_structure),
which might be more useful with less repetitive graphs such as social graphs. In particular, `EFGraph` implements a
[fast adjacency test](https://jgrapht.org/javadoc/org.jgrapht.core/org/jgrapht/Graph.html#containsEdge%28V,V%29).
You should choose the representation that better suits your data and access primitives.
jgrapht-jgrapht-1.5.2/docs/guide/ 0000775 0000000 0000000 00000000000 14424254415 0016645 5 ustar 00root root 0000000 0000000 jgrapht-jgrapht-1.5.2/docs/guide/.gitignore 0000664 0000000 0000000 00000000261 14424254415 0020634 0 ustar 00root root 0000000 0000000 # Markdown files get expanded from ../guide-templates, so ignore
# generated output here. Do NOT try to git add .md files here;
# put them in ../guide-templates instead.
*.md
jgrapht-jgrapht-1.5.2/docs/guide/hello.png 0000664 0000000 0000000 00000057620 14424254415 0020470 0 ustar 00root root 0000000 0000000 PNG
IHDR Q bKGD IDATxwXa.]A)+"⍹4S1j!1)j4M^c-b ]QRv)[8?ĕ~gݳ3.9s1@!L :ڎBH!h!hztj0 H J!J!HN]]n>C p͡6{B4]S__*TVV555H$DŐH$H$/Q]]
DF.1d2bmoRYXXqC {mjj
sss|033`ii }}}mo!QˎЀ2A(r2UVV$J7[!~333|&&&r