Commit 07ae1d7
authored
Fix error in implementation of Erdos-Gallai condition in isgraphical (#415)
* Fix error in implementation of Erdos-Gallai condition in isgraphical
# Error in current implementation
`mindeg` is computed globally at the start using `min(i, sorted_degs[i])` for all indices. However, the Erdös-Gallai condition requires dynamically calculating `min(r, sorted_degs[i])` for vertices after the current index `r`.
# What changed
* Update the Erdös-Gallai condition check to calculate the sum of the minimum of r and the degrees of the vertices.
* Add a test case in `test/connectivity.jl` to verify that `isgraphical` returns false for the sequence [4,2,2,2,0].1 parent a6571dd commit 07ae1d7
2 files changed
+36
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
801 | | - | |
| 801 | + | |
802 | 802 | | |
| 803 | + | |
803 | 804 | | |
804 | 805 | | |
805 | 806 | | |
806 | | - | |
| 807 | + | |
807 | 808 | | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
813 | 812 | | |
814 | | - | |
815 | 813 | | |
816 | 814 | | |
817 | | - | |
818 | | - | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
819 | 844 | | |
820 | 845 | | |
821 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
0 commit comments