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
bug in discovery of SRG' complements - related to twograph_descendant #26513
Comments
This comment has been minimized.
This comment has been minimized.
comment:1
There is also a bug with the database getting corrupt by an attempt to build an SRG:
whereas if the 1st call is not run then as expected one gets two more missing entries:
and the final count of missing graphs is 10. |
comment:2
The following patch fixes the discovery (but not the database inconsistency, which is a different story): diff --git a/src/sage/graphs/strongly_regular_db.pyx b/src/sage/graphs/strongly_regular_db.pyx
index e8ece2dca0..e4e3fd0189 100644
--- a/src/sage/graphs/strongly_regular_db.pyx
+++ b/src/sage/graphs/strongly_regular_db.pyx
@@ -2981,12 +2981,18 @@ def strongly_regular_graph(int v,int k,int l,int mu=-1,bint existence=False,bint
if existence:
return True
ans = f(*params)
- return check_srg(ans[0](*ans[1:]))
+ try:
+ return check_srg(ans[0](*ans[1:]))
+ except RuntimeError: # try the complement
+ pass
if f(*params_complement):
if existence:
return True
ans = f(*params_complement)
- return check_srg(ans[0](*ans[1:]).complement())
+ try:
+ return check_srg(ans[0](*ans[1:]).complement())
+ except RuntimeError: # try more functions
+ pass
# From now on, we have no idea how to build the graph.
# |
comment:3
here is a quick fix for all the issues here --- a/src/sage/graphs/strongly_regular_db.pyx
+++ b/src/sage/graphs/strongly_regular_db.pyx
@@ -1484,12 +1484,15 @@ def is_twograph_descendant_of_srg(int v, int k0, int l, int mu):
k = int(kf)
if k == kf and \
strongly_regular_graph(v+1, k, l - 2*mu + k , k - mu, existence=True) is True:
- def la(vv):
- from sage.combinat.designs.twographs import twograph_descendant
- g = strongly_regular_graph(vv, k, l - 2*mu + k)
- return twograph_descendant(g, next(g.vertex_iterator()),
- name=True)
- return la, v + 1
+ try:
+ g = strongly_regular_graph(v+1, k, l - 2*mu + k) # Sage might not know how to build g
+ def la(gg):
+ from sage.combinat.designs.twographs import twograph_descendant
+ return twograph_descendant(gg, next(gg.vertex_iterator()),
+ name=True)
+ return la, g
+ except RuntimeError: basically, |
Commit: |
Author: Dima Pasechnik |
New commits:
|
Branch: u/dimpase/graphs/srgcomplfix |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
I don't fully understand how the srg database works, but I looked at the new code and I see its point. The Everything else looks good! |
comment:8
The following works in the develop branch or 9.0, but no longer works with your version. It is the only set of parameters where I entcountered this issue, but I failed at automating my testing process.
|
comment:10
Thanks, I noticed your helpful reviews only now, as somehow I stopped receiving email notifications. I'll work on this soon. |
comment:11
I had a look at the bug yesterday evening, and I believe the issues is the lambda function at line 2903. I think inserting |
comment:12
Replying to @Ivo-Maffei:
Yes, good catch, you are right about line 2903, it should be |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
OK, this appears to fix everything. To test every graph, one can run mentioned in the manual loop (you'll need gap_packages spkg installed):
|
Reviewer: Ivo Maffei, Ferdinand Ihringer |
comment:16
Thanks! Volker, could this make it into 9.1? Just one file is touched, long-standing bug fixed. |
Changed branch from u/dimpase/graphs/srgcomplfix to |
comment:18
On Python 2:
|
Changed commit from |
Commit: |
Changed branch from |
comment:20
OK, the trivial fix by replacing unstable indices by |
Changed branch from u/dimpase/graphs/srgcomplfix to |
as reported by Ferdinand Ihringer:
This is related to the missing in Sage constructions.
In the first two cases graphs can be constructed using 2-graph descendant from Fickus et al SRGs (cf Brouwer's tables, not yet implemented in Sage), while their complements are
constructed using 2-graph descendant from known to Sage SRGs.
This illustrates a bug in discovery of SRGs via taking complements.
In the last case graphs can be constructed using 2-graph descendant from Fickus et al SRGs (cf Brouwer's tables, not yet implemented in Sage) or their complements.
There is also a discrepancy: the database gets broken after trying to build graphs.strongly_regular_graph(819, 400, 190, 200)
graphs.strongly_regular_graph(819, 418, 217, 209).
CC: @Ivo-Maffei @ferihr @vbraun
Component: graph theory
Author: Dima Pasechnik
Branch/Commit:
b267320
Reviewer: Ivo Maffei, Ferdinand Ihringer
Issue created by migration from https://trac.sagemath.org/ticket/26513
The text was updated successfully, but these errors were encountered: