#7477: Matroids
----------------------------------------------------+-----------------------
Reporter: ncohen | Owner: jkantor
Type: enhancement | Status:
needs_review
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Stefan van Zwam, Rudi Pendavingh | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------------+-----------------------
Comment (by darij):
This looks wildly useful, not just for educational purposes. I always
wanted to play around with the matroid Hopf algebra, for example...
The remarks below are mostly random and not always to the point. Most of
the code is beyound my grasp due to the use of Cython and bitsets and
partly due to advanced matroid theory. I'm just looking at random points
which seem relevant and/or understandable to me.
What does this mean:
{{{
It is up to the child class to update its data structure make information
relative to the new basis more accessible.
}}}
Typo "an an":
{{{
if `I` is covered by a matching an an appropriate bipartite graph
}}}
That said, "covered by" might be useless, given that you're not saying
"maximum matching".
In the next line, do you really mean "maximal matching", or rather
"maximum matching"? (I don't know what you want.)
Typo "Compute a the rank". Also, look out for "the the" errors, you got 2
of them.
Any chances to get some comments on {{{cdef __fundamental_cocircuit}}}
and {{{cdef __fundamental_circuit}}}? I can't say the code is self-
explanatory... Is the "fundamental circuit" of a basis B and an element y
the set of all elements of B that could be replaced by y, united with {y}?
I see why this is a circuit (when y is not in B, that is) but I haven't
seen this notation used anywhere...
Missing "of" in "of the flats the matroid" and in "of the coflats the
matroid". Also, typos: "wheter", "distinguised", "commom".
Does the docstring of {{{cpdef _augment(self, X, Y):}}} want to say
something like "nonempty (if possible) subset `I`" or "maximum subset
`I`"? Just a subset is a bit boring...
Is matroid union implemented? I can't find it in the code...
The "if" in "with the property that if no modular triple of hyperplanes
has exactly two members in the modular cut" looks out of place.
Incidentally, a definition of the notion of "hyperplane" would be of use,
too; I didn't know of that notion so far.
The {{{max_weight_independent}}} method raises an error if the ground set
is empty and the weights keyword is set, something that might happen in
practice in recursive definitions:
{{{
sage: M = matroids.Uniform(0,0)
sage: wt = {}
sage: M.max_weight_independent(weights=wt)
---------------------------------------------------------------------------
IndexError Traceback (most recent call
last)
<ipython-input-10-89b2ef4dae56> in <module>()
----> 1 M.max_weight_independent(weights=wt)
/home/darij/sage-5.9/local/lib/python2.7/site-
packages/sage/matroids/matroid.so in
sage.matroids.matroid.Matroid.max_weight_independent
(sage/matroids/matroid.c:25219)()
/home/darij/sage-5.9/local/lib/python2.7/site-
packages/sage/matroids/matroid.so in
sage.matroids.matroid.Matroid.max_weight_independent
(sage/matroids/matroid.c:24847)()
IndexError: list index out of range
}}}
This is due to the {{{if wt[-1][1] < 0:}}} line, of course. Same for
{{{max_weight_coindependent}}}.
This just looks weird:
{{{
if self.full_rank()==0:
return True
if self.full_rank()==0 or self.full_corank()==0:
return True
}}}
One of the A's should probably be an Atranspose in:
{{{
If the matroid is represented by `[I_1 A]`, then the dual
is represented by `[-A I_2]` for appropriately sized
identity matrices `I_1, I_2`.
}}}
(The minus sign, on the other hand, I don't see the reason for...)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7477#comment:24>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.