Skip to content

Refactor graph traversal logic#606

Open
clementleclercRTE wants to merge 6 commits intomainfrom
unify-graph-traversal-logics
Open

Refactor graph traversal logic#606
clementleclercRTE wants to merge 6 commits intomainfrom
unify-graph-traversal-logics

Conversation

@clementleclercRTE
Copy link

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?

What kind of change does this PR introduce?

Refactor graph traversal logic to unify depth-first and breadth-first traversal methods into a single traverseGraph implementation

What is the current behavior?

What is the new behavior (if this is a feature change)?

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:

powsybl-core PR : #3753 is needed.

… traversal methods into a single `traverseGraph` implementation.

Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
Set<Integer> done = new HashSet<>();
boolean keepGoing = true;
Set<Edge> encounteredEdges = new HashSet<>();
private boolean traverseGraph(Graph<Integer, Edge> graph, int node, TopologyTraverser traverser,
Copy link
Contributor

Choose a reason for hiding this comment

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

You could keep the traverseFromNode naming, we're not traversing the full graph here.

Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
@sonarqubecloud
Copy link

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.

2 participants