Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored sparse graphs to allow different backend implementations #1029

Merged
merged 5 commits into from
Feb 22, 2021

Conversation

d-michail
Copy link
Member

First pass over our sparse graphs support. Changes:

  • Refactored sparse graphs to allow changing the actual implementation. This is needed since there are different tradeoffs.
  • Simplified the undirected implementation which keeps source, and target matrices instead of keeping the transpose of the incidence matrix (which is really the same thing)
  • Improved the directed implementation by allowing different handling of incoming edges (full support, lazy initialization or no support). This helps saving space if some algorithm does not need incoming edges.
  • Added sparse graphs construction from streams which reduces copying.

@jsichi
Copy link
Member

jsichi commented Feb 14, 2021

Could you merge from master? We had a problem with Travis CI, so pull requests weren't getting CI build runs.

*
* @return the number of edges
*/
int edgesCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a brand new interface, would it make sense to use long instead of int with an eye towards GraphIterables?

@jsichi
Copy link
Member

jsichi commented Feb 22, 2021

Just realized that my last comment was a little silly given the Integer type for vertex/edge. But I guess its better for uniformity in case we introduce a BigSparseSpecifics, and you've already made the changes, so merging now. Thanks!

@jsichi jsichi merged commit 46d3a04 into jgrapht:master Feb 22, 2021
@syoon2 syoon2 mentioned this pull request Apr 12, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants