Skip to content

feat(graph): add bfs#274

Open
vincentkoppen wants to merge 6 commits into
mainfrom
pgm/add-bfs
Open

feat(graph): add bfs#274
vincentkoppen wants to merge 6 commits into
mainfrom
pgm/add-bfs

Conversation

@vincentkoppen

@vincentkoppen vincentkoppen commented Jun 12, 2026

Copy link
Copy Markdown
Member

Part of #161

(First) implementation of bfs, please give feedback if anything is missing


Updated: now returns a list of (node, parent)

Signed-off-by: Vincent Koppen <vincent.koppen@alliander.com>
Signed-off-by: Vincent Koppen <vincent.koppen@alliander.com>
@vincentkoppen vincentkoppen changed the title feat: add bfs feat(graph): add bfs Jun 12, 2026
Signed-off-by: Vincent Koppen <vincent.koppen@alliander.com>
vincentkoppen and others added 2 commits June 16, 2026 10:15
Signed-off-by: Vincent Koppen <vincent.koppen@alliander.com>
@vincentkoppen vincentkoppen marked this pull request as ready for review June 16, 2026 08:35
Comment thread tests/unit/model/graphs/test_graph_model.py Outdated
Signed-off-by: Vincent Koppen <53343926+vincentkoppen@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

source(int | Sequence[int]): the source(s) the start the breadth first search from.

Returns:
list[tuple[int, int | None]]: the (node, parent) by the order in which we found the nodes.

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.

For this and the dfs PR: is it most natural to return (node, parent) or (parent, node)? For me the latter feels more easily to follow as you travel from parent to child

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