-
Notifications
You must be signed in to change notification settings - Fork 102
WIP: Add an is_chordal
algorithm
#434
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
base: master
Are you sure you want to change the base?
WIP: Add an is_chordal
algorithm
#434
Conversation
We implement Tarjan and Yannakakis (1984)'s MCS algorithm, taking inspiration from the existing NetworkX implementation. Everything is done except for example doctests in src/chordality.jl and unit tests in test/chordality.jl. (This PR is part of a new suite of algorithms outlined in issue JuliaGraphs#431.)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #434 +/- ##
==========================================
- Coverage 97.41% 97.09% -0.32%
==========================================
Files 120 121 +1
Lines 6953 6982 +29
==========================================
+ Hits 6773 6779 +6
- Misses 180 203 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do you by any change know where I could find a public accessible version of that paper? My usual methods did not help. |
The paper is attached here, courtesy of the UMass library. |
Wonderful, @Krastanov, thanks! |
@simonschoelly, just wanted to let you know I certainly haven't abandoned this PR. I was busy with work this past week and I'm at a conference this weekend, but I'll get back to it shortly. I've looked over your comments and it shouldn't be many more changes at all anyway, hehe. |
Originally, we restricted the input type for is_chordal to AbstractSimpleGraph to rule out parallel edges, but some other graph types we would like to support (such as SimpleWeightedGraph) are of the more general AbstractGraph type. It turns out the current AbstractGraph interface aleady does not support parallel edges, so there is no worry here--it is already stated in the Implementation Notes anyway that is_chordal should not take in graphs with parallel edges as input.
@simonschoelly, just changed the input type from |
Wait—I just remembered your comment about induced subgraphs. I'll think about that and get back to you I was largely just porting over networkx's implementation, which does do this, but it probably really isn't optimal. |
Don't worry - we are quite slow with reviewing PRs here :D |
Originally mirroring the networkx implementation, we created a new AbstractGraph object every time we tested subsequent neighbors in the potential PEO with the induced_subgraph function. This commit makes our implementation more performant by simply taking the vertex (sub)set and checking to see if all pairs are adjacent via iteration. Additionally, we change inconsistent naming in certain parts ('node' vs 'vertex'), changing everything to 'vertex' where relevant.
@simonschoelly @Krastanov I've fixed the issue regarding unnecessary allocations with |
We implement Tarjan and Yannakakis (1984)'s MCS algorithm, taking inspiration from the existing NetworkX implementation. Everything is done except for example doctests in
src/chordality.jl
and unit tests intest/chordality.jl
. (This PR is part of a new suite of algorithms outlined in issue #431.)