-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Added chodal_simplicial_vertex function #1861
Conversation
The main loop uses
Note also that some "corner" cases may exist.. I think isolated nodes might be found by this routine. Maybe that is OK... I don't know enough about the applications. Similarly, nodes of degree 1 would qualify. You should spell check the doc_string. Thanks! |
@@ -242,6 +243,48 @@ def chordal_graph_treewidth(G): | |||
max_clique = max(max_clique,len(clique)) | |||
return max_clique - 1 | |||
|
|||
def chordal_simplicial_vertex(G): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the decorator @not_implemnted_for('directed','multigraph')
here. This will raise NetworkXNotImplemented
, which seems much more relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, if this could be added to is_chordal
function instead.
Thank you for reply @dschult and @SanketDG. Vertices with degree at most one can be considered as simplicial vertices. These definition will be useful while creating the pre-vertex ordering for Chordal graphs (both for disconnected and connected). I second with @SanketDG that Not_implemented_for should be for is_chordal if we are not planning to handle directed chordal graph soon. |
@@ -9,6 +9,7 @@ | |||
import networkx as nx | |||
import random | |||
import sys | |||
from ...utils import not_implemented_for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use from networkx.utils import not_implemented_for
instead.
Needs updating to address comments. |
This hasn't been updated in a while, I'll go ahead and close this PR. Thanks for your work on this @hector1618 ! |
I have added small function to get simplicial vertex for chordal graph.
Main objective is to get some preliminary code review before further work.