Improve naive connectivity calculation performance#1347
Merged
SylvestreSakti merged 8 commits intomainfrom Mar 26, 2026
Merged
Conversation
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
|
src/main/java/com/powsybl/openloadflow/graph/NaiveGraphConnectivity.java
Show resolved
Hide resolved
flo-dup
reviewed
Feb 24, 2026
|
|
||
| @Override | ||
| public int getNeighborEdgeCountOf(V v) { | ||
| return delegate.getNeighborEdgeCountOf(v); |
Contributor
There was a problem hiding this comment.
Shouldn't you use directly the adjacencyList?
Suggested change
| return delegate.getNeighborEdgeCountOf(v); | |
| return adjacencyList.get(v).size(); |
Member
There was a problem hiding this comment.
I think it does not change anything to keep the old line
SylvestreSakti
approved these changes
Mar 19, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Performance
What is the current behavior?
So called "naive" connectivity rely on jgrapht connectivity inspector. The naive connectivity is the one use when running the security analysis with remedial actions.
What is the new behavior (if this is a feature change)?
We now use the one from powsybl core which is around 5 times faster than jgrapht one.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: