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
Improve efficiency of minors() for BinaryMatroid, TernaryMatroid, QuaternaryMatroid #18660
Comments
comment:1
Still need to try this out. Hope to do this this week. Since a cocircuit of a binary matroid M is typically going to have size about |
Commit: |
comment:3
First worked on BinaryMatroid and BinaryMatrix. The new code seems to be correct:
It's more efficient too. Without the patch:
With the patch:
So, about 5 times faster on this example. This is not all due to the trick announced in the ticket. Replacing a list by a c-style array here and there did some good too. And just replacing the line
in New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
Correctness:
Efficiency before patch:
Efficiency after patch:
For TernaryMatrix and QuaternaryMatrix, there was no optimized submatrix-code to begin with, hence the 40 - 80 times speedup. I will remove some lingering cython profile directives, and then I'm done. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Rudi Pendavingh |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
Before:
After:
|
Reviewer: Travis Scrimshaw |
comment:10
LGTM. I'm slightly unhappy with the fact that it looks like a lot of logic is duplicated across the multiple |
comment:11
Replying to @tscrim:
Thanks for the review. |
The representing matrices of BinaryMatroid, TernaryMatroid, QuaternaryMatroid, are bitpacket. Taking minors, involves constructing a submatrix of such a representing matrix. Since the rows are bitpacked, the relocation of columns in particular is relatively inefficient.
By allowing a submatrix in which the columns are allowed to be permuted, it is possible to reduce the number of column relocations to at most the number of deleted columns, and this will be far more efficient than the current implementation, especially if few columns are deleted.
CC: @chaoxu @sagetrac-Stefan @sagetrac-yomcat
Component: matroid theory
Author: Rudi Pendavingh
Branch/Commit:
a5fd2f5
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/18660
The text was updated successfully, but these errors were encountered: