Skip to content

Set up permutahedron with both Vrep and Hrep (if backend supports it) #29325

@kliem

Description

@kliem

We set up the permutahedron with both Vrepresenation and Hrepresentation, if the backend supports it.

If the backend supports precomputed data (currently field) this is much faster. Otherwise, this is a bit faster, as the Hrepresentation seems to be the better choice.

Before this ticket:

sage: %timeit P = polytopes.permutahedron(6)  # using ppl
10 loops, best of 5: 56.5 ms per loop
sage: %timeit P = polytopes.permutahedron(7)  # using ppl
1 loop, best of 5: 1.57 s per loop

With this ticket:

sage: %timeit P = polytopes.permutahedron(6)  # using ppl
10 loops, best of 5: 34.2 ms per loop
sage: %timeit P = polytopes.permutahedron(7)  # using ppl
1 loop, best of 5: 1.04 s per loop
sage: %time P = polytopes.permutahedron(8, backend='field')
CPU times: user 587 ms, sys: 20 ms, total: 607 ms
Wall time: 607 ms
sage: %time P = polytopes.permutahedron(9, backend='field')
CPU times: user 5.08 s, sys: 248 ms, total: 5.33 s
Wall time: 5.33 s

Note that field is much slower than ppl before this ticket and the timings are therefore omitted.

As the order of Vrepresentation and Hrepresentation changes, a lot of tests need to be fixed.

CC: @jplab @LaisRast

Component: geometry

Keywords: polytopes, precomputed data, permutahedron

Author: Jonathan Kliem

Branch/Commit: 577e736

Reviewer: Jean-Philippe Labbé, Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/29325

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions