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

Speed up Polyhedron_base.graph() #20110

Closed
jplitza mannequin opened this issue Feb 25, 2016 · 5 comments
Closed

Speed up Polyhedron_base.graph() #20110

jplitza mannequin opened this issue Feb 25, 2016 · 5 comments

Comments

@jplitza
Copy link
Mannequin

jplitza mannequin commented Feb 25, 2016

Currently, Polyhedron_base.graph() intersects with the base set of all vertices in every of the n over 2 loop iterations in line 3321, where n is the number of vertices. This is useless as far as I can see, because the sets that are being intersected cannot possibly ever contain something that is not a vertex.

Leaving out this additional intersection speeds up the process of constructing the graph significantly. I tested it on a 4 GHz machine for the polyhedron polytopes.associahedron(['E', 7]), and with my patch it only took close to two minutes instead of 5:15. Other examples like polytopes.associahedron(['E', 8]) also suggest a significant speedup, although I don't have precise measurements from the same machine.

I also tested that the resulting graph is actually the same for some polyhedra.

Component: geometry

Author: Jan-Philipp Litza

Branch/Commit: 0a2602f

Reviewer: Volker Braun

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

@jplitza jplitza mannequin added this to the sage-7.1 milestone Feb 25, 2016
@jplitza jplitza mannequin added c: geometry labels Feb 25, 2016
@vbraun
Copy link
Member

vbraun commented Feb 25, 2016

comment:1

Looks good to me. I assume tests pass. You should set tickets to "needs review" when you are ready...

@jplitza jplitza mannequin added the s: needs review label Feb 26, 2016
@vbraun
Copy link
Member

vbraun commented Feb 26, 2016

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented Feb 26, 2016

comment:3

Can you fill in the "Author" field with your real name?

@jplitza
Copy link
Mannequin Author

jplitza mannequin commented Feb 27, 2016

Author: Jan-Philipp Litza

@vbraun
Copy link
Member

vbraun commented Feb 28, 2016

Changed branch from u/jplitza/polyhedron_graph to 0a2602f

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

1 participant