Skip to content

C++ Backend for Graph Utilities #633

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 3 commits into from
Mar 20, 2025
Merged

Conversation

prex03
Copy link
Contributor

@prex03 prex03 commented Mar 12, 2025

This PR adds C++ backend for Graph Nodes and Edges which can be used to implement the backend for Graphs.

These changes were made -

  1. Backend for GraphNode (Abstract class), AdjacencyMatrixGraphNode, AdjacencyListGraphNode and GraphEdge is added according to their corresponding python implementations.
  2. Tests (similar to those being done for the python backend) are added for C++ backend as well.

@czgdp1807
Copy link
Member

Hey @prex03. Please check your WhatsApp DM to discuss this further.

Comment on lines +8 to +12
typedef struct {
PyObject_HEAD
std::string name;
PyObject* data;
} GraphNode;
Copy link
Member

@czgdp1807 czgdp1807 Mar 20, 2025

Choose a reason for hiding this comment

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

For next PR,

Suggested change
typedef struct {
PyObject_HEAD
std::string name;
PyObject* data;
} GraphNode;
template <typename T>
typedef struct {
PyObject_HEAD
std::string name;
T data;
} GraphNode<T>;

float (32, 64), int (8, 32, 64) , string, char, complex.

@czgdp1807 czgdp1807 enabled auto-merge (squash) March 20, 2025 17:47
@czgdp1807 czgdp1807 merged commit 4d1116d into codezonediitj:main Mar 20, 2025
7 checks passed
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.340%. Comparing base (f4c1677) to head (966cf18).
Report is 4 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##              main      #633       +/-   ##
=============================================
- Coverage   97.345%   97.340%   -0.005%     
=============================================
  Files           36        36               
  Lines         4445      4550      +105     
=============================================
+ Hits          4327      4429      +102     
- Misses         118       121        +3     
Files with missing lines Coverage Δ
pydatastructs/utils/_extensions.py 100.000% <100.000%> (ø)
pydatastructs/utils/misc_util.py 99.163% <100.000%> (+0.021%) ⬆️

Impacted file tree graph

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@prex03 prex03 deleted the graph_util branch March 25, 2025 15:45
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