#18539: faster matroid 3 connectivity
-------------------------------------+-------------------------------------
Reporter: chaoxu | Owner: chaoxu
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.8
Component: matroid theory | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/chaoxu/faster_matroid_3_connectivity|
23cfab190acc6e26bd0bc20276e028438964ea95
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by Rudi):
Replying to [comment:8 chaoxu]:
> For the base case, I need to access Uniform(r,n). A direct import seems
to cause circular dependency. If I use
>
> {{{
> from sage.matroids.catalog import Uniform
> # some code that calls Uniform(r,n)
> }}}
>
> then the error `ImportError: cannot import name Uniform` appears during
runtime.
> Somehow using `from sage.matroids.catalog import *` and write
`sage.matroids.catalog.Uniform(r,n)` for every call works out. I wonder if
there are better ways.
A matroid of rank 1 is uniform if and only if it has no loops, and dually
a matroid of corank 1 is uniform iff it has no coloops. So you could also
replace your test
{{{
if (self.size() <= 1 or
self.is_isomorphic(sage.matroids.catalog.Uniform(1,2)) or
self.is_isomorphic(sage.matroids.catalog.Uniform(1,3)) or
self.is_isomorphic(sage.matroids.catalog.Uniform(2,3))):
return True
}}}
with this simpler one
{{{
if self.size() <= 1:
return True
if self.size() <= 3 and self.full_rank()==1 and not self.loops():
return True
if self.size() <= 3 and self.full_corank()==1 and not self.coloops():
return True
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18539#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.