Skip to content
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

Add Dorogovtsev-Goltsev-Mendes graph generator #1206

Merged
merged 6 commits into from
Jun 1, 2024

Conversation

dfacoet
Copy link
Contributor

@dfacoet dfacoet commented May 31, 2024

Related to #150.

This adds generator functions for Dorogovtsev-Goltsev-Mendes graphs to both rustworkx and rustworkx-core.

First contribution, feedback is welcome.

Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

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

Overall Rust code looks good. I did leave some comments about the Python tests though. I am not an expert on this type of graph but I think we can add some code to ensure at least it keeps the core properties

for n in range(0, 6):
graph = rustworkx.generators.dorogovtsev_goltsev_mendes_graph(n)
self.assertEqual(len(graph), (3**n + 3) // 2)
self.assertEqual(len(graph.edges()), 3**n)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is also worth checking that the graph you generate is planar. We have https://www.rustworkx.org/apiref/rustworkx.is_planar.html

@coveralls
Copy link

coveralls commented Jun 1, 2024

Pull Request Test Coverage Report for Build 9330743739

Details

  • 46 of 47 (97.87%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 95.824%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/generators.rs 13 14 92.86%
Totals Coverage Status
Change from base Build 9301444525: 0.006%
Covered Lines: 17300
Relevant Lines: 18054

💛 - Coveralls

@dfacoet
Copy link
Contributor Author

dfacoet commented Jun 1, 2024

Thanks @IvanIsCoding for the review, I made the changes to the tests.

Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for addressing the feedback quickly! Hopefully we release it in 0.15 soon-ish

@IvanIsCoding IvanIsCoding merged commit c40b169 into Qiskit:main Jun 1, 2024
28 checks passed
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.

3 participants