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

Improve obtaining combinatorial polyhedron #29841

Closed
kliem opened this issue Jun 10, 2020 · 16 comments
Closed

Improve obtaining combinatorial polyhedron #29841

kliem opened this issue Jun 10, 2020 · 16 comments

Comments

@kliem
Copy link
Contributor

kliem commented Jun 10, 2020

This ticket improves obtaining the CombinatorialPolyhedron from an incidence matrix.

Along the way we also improve the method CombinatorialPolyhedron.incidence_matrix that reobtains the incidence matrix.

Note that #29837 greatly speeds up obtainment of incidence matrices in Polyhedron_base.

Without this ticket:

sage: P = polytopes.permutahedron(7)
sage: _ = P.incidence_matrix()
sage: %time C = CombinatorialPolyhedron(P)
CPU times: user 821 ms, sys: 19.4 ms, total: 840 ms
Wall time: 842 ms
sage: C.incidence_matrix.clear_cache()
sage: %time _ = C.incidence_matrix()
CPU times: user 24.8 ms, sys: 22 µs, total: 24.8 ms
Wall time: 24.6 ms

sage: P = polytopes.associahedron(['A', 9])
sage: _ = P.incidence_matrix()
sage: %time C = CombinatorialPolyhedron(P)
CPU times: user 1.08 s, sys: 36.1 ms, total: 1.11 s
Wall time: 1.11 s
sage: C.incidence_matrix.clear_cache()
sage: %time _ = C.incidence_matrix()
CPU times: user 94.2 ms, sys: 0 ns, total: 94.2 ms
Wall time: 93.8 ms

With this ticket:

sage: P = polytopes.permutahedron(7)
sage: _ = P.incidence_matrix()
sage: %time C = CombinatorialPolyhedron(P)
CPU times: user 77.6 ms, sys: 12 ms, total: 89.6 ms
Wall time: 88 ms
sage: C.incidence_matrix.clear_cache()
sage: %time _ = C.incidence_matrix()
CPU times: user 17 ms, sys: 14 µs, total: 17 ms
Wall time: 16.7 ms

sage: P = polytopes.associahedron(['A', 9])
sage: _ = P.incidence_matrix()
sage: %time C = CombinatorialPolyhedron(P)
CPU times: user 110 ms, sys: 0 ns, total: 110 ms
Wall time: 109 ms
sage: C.incidence_matrix.clear_cache()
sage: %time _ = C.incidence_matrix()
CPU times: user 65.3 ms, sys: 18 µs, total: 65.3 ms
Wall time: 64.3 ms

Depends on #29837

CC: @jplab @LaisRast

Component: geometry

Keywords: combinatorial polyhedron

Author: Jonathan Kliem

Branch/Commit: 2db3a70

Reviewer: Travis Scrimshaw

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

@kliem kliem added this to the sage-9.2 milestone Jun 10, 2020
@kliem
Copy link
Contributor Author

kliem commented Jun 10, 2020

Branch: public/29841

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2020

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

7b70830rename
47a19c6implement slack matrix
54755d7Merge branch 'public/29838' of git://trac.sagemath.org/sage into public/29837-reb
a4576d6set up incidence/adjacency matrix with GF(2)
30c4715Merge branch 'public/29840' of git://trac.sagemath.org/sage into public/29837-reb
fcd62d2determine is_zero beforehand
13b8583small fix
89aeab3obtain incidence matrix from slack matrix
d8e4153improve initialization of CombinatorialPolyhedron
464f5c5reobtain incidence matrix more quickly

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2020

Commit: 464f5c5

@kliem
Copy link
Contributor Author

kliem commented Jun 10, 2020

New commits:

62f1ff9use integer matrix for zero_pattern_matrix
88f6025Merge branch 'public/29838' of git://trac.sagemath.org/sage into public/29837-reb2
7cee020determine is_zero beforehand
3d28d09small fix
7ef6a11use slack matrix to obtain incidence matrix quicker
7ff9f92improve initialization of CombinatorialPolyhedron
20d22a8mod2 -> integer; improve reobtainment of incidence matrix
addee64do not delete columns if we do not have to

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Jun 10, 2020

Changed branch from public/29841 to public/29841-reb

@kliem
Copy link
Contributor Author

kliem commented Jun 10, 2020

Changed commit from 464f5c5 to addee64

@kliem
Copy link
Contributor Author

kliem commented Jun 17, 2020

Changed branch from public/29841-reb to public/29841-reb2

@kliem
Copy link
Contributor Author

kliem commented Jun 17, 2020

Changed commit from addee64 to 2db3a70

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Jun 17, 2020

Last 10 new commits:

2a08abesmall mistakes
333c4bawrong doctest
82c6b4adocstring
211f4f1Merge branch 'public/29839' of git://trac.sagemath.org/sage into public/29837-reb3
4c5433edetermine is_zero beforehand
27a1b90use slack matrix to obtain incidence matrix quicker
764a99baccount for change in #29839
1b654c4improve initialization of CombinatorialPolyhedron
527316dmod2 -> integer; improve reobtainment of incidence matrix
2db3a70do not delete columns if we do not have to

@kliem

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Jul 1, 2020

comment:7

LGTM.

@tscrim
Copy link
Collaborator

tscrim commented Jul 1, 2020

Reviewer: Travis Scrimshaw

@kliem
Copy link
Contributor Author

kliem commented Jul 1, 2020

comment:8

Thank you.

@vbraun
Copy link
Member

vbraun commented Jul 10, 2020

Changed branch from public/29841-reb2 to 2db3a70

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