Skip to content

Matrices over Tropical Semiring #41195

@xcaruso

Description

@xcaruso

Problem Description

I would like to use matrices over TropicalRing(QQ) but it does not work out of the box:

sage: T = TropicalSemiring(QQ)
sage: matrix(T, [[0,1],[2,3]])
Traceback (most recent call last):
...
TypeError: base_ring (=Tropical semiring over Rational Field) must be a ring

Beyond basic operations, the feature I am mostly interested is the computation of the so-called maximum cycle mean. (I'm not really aware about the algorithms for doing it but I understood that it is a classical and very important problem in the theory.)

Cc @tscrim

Proposed Solution

I would say that the best thing to do is to rewrite from a scratch a class for matrices over semirings.

Alternatives Considered

Another option would be to make the Matrix class more permissive but it would certainly be the source of other problems.

Any thoughts about it?

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

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions