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

TST: Add test which verifies number of spanning trees using Kirchhoff's Matrix-Tree Theorem #75

Closed
1 of 2 tasks
nawtrey opened this issue Sep 7, 2023 · 3 comments
Closed
1 of 2 tasks
Labels
good first issue Good for newcomers testing Testing/verification related improvements/bugs

Comments

@nawtrey
Copy link
Collaborator

nawtrey commented Sep 7, 2023

Description

There is currently a test which verifies the correct number of partial and directional diagrams are generated for maximally-connected graphs of various sizes, but this can be expanded to include graphs of arbitrary complexity using Kirchhoff's Theorem. The paper that inspired this can be found here. This is important because we currently only test edge cases, but it would be better to include many of the graphs we use throughout our tests and analysis. Some of this is discussed in #22.

TODO

  • Add a function to graph_utils.pydiagrams.py which calculates any cofactor of the Laplacian matrix for an input graph and outputs the number of spanning trees (partial diagrams) for that graph
  • Add a test which leverages this function and compares expected values to the output values for many moderately-connected graphs
@nawtrey nawtrey added good first issue Good for newcomers testing Testing/verification related improvements/bugs labels Sep 7, 2023
@nawtrey nawtrey added the enhancement New feature or request label Mar 23, 2024
@nawtrey
Copy link
Collaborator Author

nawtrey commented Mar 23, 2024

It looks like this was partially addressed in commit 1db2203 (I've checked off the first task to reflect this).

While some checks were added to existing tests (3-state, 4-state, 4-state leakage, 5-state leakage, 6-state) I think it would be good to create a dedicated test for this that covers more complex models, and checks both partial diagram and directional diagram counts, since they rely on different algorithms to generate them.

@nawtrey
Copy link
Collaborator Author

nawtrey commented Mar 23, 2024

This may warrant a new issue, but it looks like this has been implemented upstream in networkx (see here). I think once the KDA API is in a better state we will remove our version of this and just add a method that calls the networkx version.

@nawtrey nawtrey removed the enhancement New feature or request label Aug 5, 2024
@nawtrey
Copy link
Collaborator Author

nawtrey commented Aug 10, 2024

I think I will close this. We already have a test test_diagram_counts that verifies the number of partial and directional diagrams for 5 different test models. If we think this is not thorough enough we can reopen later.

@nawtrey nawtrey closed this as completed Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers testing Testing/verification related improvements/bugs
Projects
None yet
Development

No branches or pull requests

1 participant