Skip to content

Cache matroid circuit computation #36820

@trevorkarn

Description

@trevorkarn

Problem Description

The current implementation of matroid circuit computations does not cache the result.

  sage: M = matroids.CompleteGraphic(7)
  ....: 
  ....: %time C1 = M.circuits();
  ....: 
  ....: %time C2 = M.circuits();
  CPU times: user 5.65 s, sys: 26.4 ms, total: 5.68 s
  Wall time: 5.72 s
  CPU times: user 5.81 s, sys: 47 ms, total: 5.86 s
  Wall time: 6.14 s

Proposed Solution

It would be nice to cache the result rather than recomputing it.

Alternatives Considered

An alternative is to require the user to know that this is not cached and instead manually store it wherever makes sense when doing a relevant computation.

Additional Information

No response

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions