#18946: unweighted matroid intersection using blocking flow approach
-------------------------------------+-------------------------------------
Reporter: chaoxu | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.9
Component: matroid theory | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: u/chaoxu/faster- | Commit:
abstract-matroid-intersection | 195feb847638db2c2b1763a1283c9ef31a81fa25
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by chaoxu):
* status: needs_work => needs_review
Comment:
This is extremely strange.
There are 2 steps in the algorithm. First one is construct the level
graph, then do many augmentation in a batch.
The bad running time comes from the "construct the level graph" in my
code. I have no idea why is my version so much slower. (probably due to
ordering of the elements, since it actually use fewer `_closure()` tests)
I replaced it with the one in `_intersection_augmentation()` and
apparently solved this problem.
This update was done quickly, hence this probably need more testing.
{{{
sage: M1 = Matroid(MatrixSpace(GF(7), 500, 2000).random_element())
sage: M2 = Matroid(MatrixSpace(GF(3), 500, 2000).random_element())
sage: %time X = M1.intersection(M2)
CPU times: user 44.6 s, sys: 481 ms, total: 45 s
Wall time: 45.3 s
sage: %time X2 = M1._intersection_unweighted(M2)
CPU times: user 39 s, sys: 52.2 ms, total: 39 s
Wall time: 37.2 s
sage: M1 = Matroid(MatrixSpace(GF(2), 500, 2000).random_element())
sage: M2 = Matroid(MatrixSpace(GF(2), 500, 2000).random_element())
sage: %time X = M1.intersection(M2)
CPU times: user 1.52 s, sys: 332 ms, total: 1.85 s
Wall time: 1.85 s
sage: %time X2 = M1._intersection_unweighted(M2)
CPU times: user 191 ms, sys: 2.93 ms, total: 194 ms
Wall time: 194 ms
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18946#comment:8>
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.