-
Notifications
You must be signed in to change notification settings - Fork 108
Implement isdigraphical
and fix isgraphical
#186
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
Changes from all commits
21d9de2
e430a25
9431883
a250bed
e8d6258
3c82b52
76b1bd5
f2694a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,21 @@ | |
@test @inferred(!isgraphical([1, 1, 1])) | ||
@test @inferred(isgraphical([2, 2, 2])) | ||
@test @inferred(isgraphical(fill(3, 10))) | ||
@test @inferred(isgraphical(Integer[])) | ||
##@test !@inferred(isgraphical([2])) | ||
|
||
# Test simple digraphicality | ||
sdg = SimpleDiGraph(10, 90) | ||
@test @inferred(isdigraphical(indegree(sdg), outdegree(sdg))) | ||
@test !@inferred(isdigraphical([1, 1, 1], [1, 1, 0])) | ||
@test @inferred(isdigraphical(Integer[], Integer[])) | ||
#@test !@inferred(isdigraphical([1], [1])) | ||
# Self loops should be excluded | ||
@test !@inferred(isdigraphical([1], [1])) | ||
@test !@inferred(isdigraphical([1, 0], [1, 0])) | ||
# Multi edges should be excluded | ||
@test !@inferred(isdigraphical([5], [5])) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also have a few edge cases here? Such as
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've just noticed that For example:
|
||
# 1116 | ||
gc = cycle_graph(4) | ||
for g in testgraphs(gc) | ||
|
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.
We should probably mention here that
indegree_sequence
andoutdegree_sequence
are not independent, i.e. if entryi
ofindegree_sequence
has valuea_i
and entryi
ofoutdegree_sequence
has valueb_i
then there will be a vertex with indegreea_i
and outdegreeb_i
in the realization. (maybe there is an easier way to express this).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.
We modified the docstring trying to include your suggestions. Thanks.