Skip to content

Improve naive connectivity calculation performance#1347

Merged
SylvestreSakti merged 8 commits intomainfrom
improve_naive_connectivity
Mar 26, 2026
Merged

Improve naive connectivity calculation performance#1347
SylvestreSakti merged 8 commits intomainfrom
improve_naive_connectivity

Conversation

@geofjamg
Copy link
Copy Markdown
Member

@geofjamg geofjamg commented Feb 10, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

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?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@sonarqubecloud
Copy link
Copy Markdown

@geofjamg geofjamg marked this pull request as ready for review February 20, 2026 12:57

@Override
public int getNeighborEdgeCountOf(V v) {
return delegate.getNeighborEdgeCountOf(v);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't you use directly the adjacencyList?

Suggested change
return delegate.getNeighborEdgeCountOf(v);
return adjacencyList.get(v).size();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it does not change anything to keep the old line

@sonarqubecloud
Copy link
Copy Markdown

@SylvestreSakti SylvestreSakti merged commit 149631f into main Mar 26, 2026
7 checks passed
@SylvestreSakti SylvestreSakti deleted the improve_naive_connectivity branch March 26, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants