Skip to content
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

Another improvement for face iterator of simple/simplicial polytopes #33645

Closed
kliem opened this issue Apr 5, 2022 · 9 comments
Closed

Another improvement for face iterator of simple/simplicial polytopes #33645

kliem opened this issue Apr 5, 2022 · 9 comments

Comments

@kliem
Copy link
Contributor

kliem commented Apr 5, 2022

Follow up on #30040:

If we are in a lattice, such that all intervals [F, G] are boolean, if F is not the lower bound, then any face except the lower bound, has a unique representation as meet of coatoms.

This means that we do not need to mark a face as visited, when removing it from the coatoms.

Before (benchmarks without parallelization):

sage: P = polytopes.cyclic_polytope(10, 22)
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
43.2 ms ± 40 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: P = polytopes.associahedron(['A', 8])
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
20.1 ms ± 69.3 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: P = polytopes.hypercube(12, backend='field')
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
38.6 ms ± 464 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: P = polytopes.Birkhoff_polytope(5)  # neither simple nor simplicial
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
275 ms ± 531 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)

After (benchmarks without parallelization):

sage: P = polytopes.cyclic_polytope(10, 22)
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
38.6 ms ± 1.07 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: P = polytopes.associahedron(['A', 8])
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
18.3 ms ± 23.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
sage: P = polytopes.hypercube(12, backend='field')
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
30.9 ms ± 40 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: P = polytopes.Birkhoff_polytope(5)  # neither simple nor simplicial
sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0)
274 ms ± 410 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)

CC: @tscrim @yuan-zhou

Component: geometry

Author: Jonathan Kliem

Branch/Commit: 04ca6fb

Reviewer: Travis Scrimshaw

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

@kliem kliem added this to the sage-9.6 milestone Apr 5, 2022
@kliem
Copy link
Contributor Author

kliem commented Apr 5, 2022

Author: Jonathan Kliem

@kliem
Copy link
Contributor Author

kliem commented Apr 5, 2022

New commits:

04ca6fbfurther improvement for face iterator over simple/simplicial polytopes

@kliem
Copy link
Contributor Author

kliem commented Apr 5, 2022

Branch: public/33645

@kliem
Copy link
Contributor Author

kliem commented Apr 5, 2022

Commit: 04ca6fb

@kliem

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Apr 6, 2022

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Apr 6, 2022

comment:2

LGTM.

@kliem
Copy link
Contributor Author

kliem commented Apr 6, 2022

comment:3

Thank you.

@vbraun
Copy link
Member

vbraun commented Apr 10, 2022

Changed branch from public/33645 to 04ca6fb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants