Skip to content

Add C++ Backend for BFS and Use std::variant for Graph Node Data #684

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

Merged
merged 17 commits into from
Jun 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bug fix
  • Loading branch information
Prerak Singh authored and Prerak Singh committed Jun 19, 2025
commit f0fa26293c5d3789f63f8d546907e311af5ab21c
2 changes: 0 additions & 2 deletions pydatastructs/graphs/_backend/cpp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
from . import _graph
from . import _algorithms
6 changes: 3 additions & 3 deletions pydatastructs/graphs/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pydatastructs.graphs.graph import Graph
from pydatastructs.linear_data_structures.algorithms import merge_sort_parallel
from pydatastructs import PriorityQueue
from pydatastructs.graphs._backend.cpp import _algorithms
from pydatastructs.graphs._backend.cpp._algorithms import bfs_adjacency_list, bfs_adjacency_matrix

__all__ = [
'breadth_first_search',
Expand Down Expand Up @@ -95,10 +95,10 @@ def breadth_first_search(
else:
if (graph._impl == "adjacency_list"):
extra_args = args if args else ()
return _algorithms.bfs_adjacency_list(graph, source_node, operation, extra_args)
return bfs_adjacency_list(graph, source_node, operation, extra_args)
if (graph._impl == "adjacency_matrix"):
extra_args = args if args else ()
return _algorithms.bfs_adjacency_matrix(graph, source_node, operation, extra_args)
return bfs_adjacency_matrix(graph, source_node, operation, extra_args)

def _breadth_first_search_adjacency_list(
graph, source_node, operation, *args, **kwargs):
Expand Down
Loading