Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #20110: Speed up Polyhedron_base.graph()
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. URL: http://trac.sagemath.org/20110 Reported by: jplitza Ticket author(s): Jan-Philipp Litza Reviewer(s): Volker Braun
- Loading branch information