-
-
Notifications
You must be signed in to change notification settings - Fork 488
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 edges/ridges for simple/simplicial polytopes #33611
Comments
This comment has been minimized.
This comment has been minimized.
New commits:
|
Changed branch from u/gh-kliem/improved_edges_ridges_heuristic to u/gh-kliem/improved_edge_ridge_heuristic |
Commit: |
comment:5
Maybe irrelevant to this ticket, but are there better criteria than n_Vrepresentation > (n_facets)2 (or n_Vrepresentation2 < n_facets) in which cases one knows that the primal (or the dual) algorithm is faster? "Wild estimates" plus special treatment for simple/simplicial polytopes does not seem optimal to me. If we don't know a better criterion, does it make sense to leave the choice to the user, as an optional input? |
Reviewer: Travis Scrimshaw |
comment:6
I also think it would be good to answer that question and +1 for adding an option for the user to select. However, that can be left to another ticket. For the change in this ticket. LGTM modulo the order of the checks. How expensive is the |
comment:7
I think it is a good idea to expose the primal/dual or automatic options. I really don't know, when the algorithm is faster which way. Like I know for fixed polyhedra, but I have no clue in general. It is surprising how the primal algorithm even to generate edges is much better than the dual algorithm in many cases. What do you think is better:
At the moment the |
comment:9
Maybe it makes sense to cache
As for the complexity of the primal and dual algorithm (for edges):
To estimate One could use those things to get a better estimate, but I don't know if this would be any good. Exposing the algorithm might be the better choice here. |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Yuan Zhou |
comment:10
Thank you for providing the complexity details! The formulas look very neat. I think it would be nice to use them in the code, especially when I like the keyword +1 for caching +1 for "This is quite a micro-optimization, so if you don't want to be bothered with it, you can set a positive review." |
comment:11
comment:7: I would use comment:9: Thank you. I agree with Yuan that they should be cached. From what you're saying, I agree that they should be last in the checking order. Could there be a typo in your formulas? I don't understand what |
Dependencies: #33644 |
comment:13
Replying to @tscrim:
I also think this is a better name, but it involves deprecation. But well, that's life I guess.
A typo, fixed now. Also the simple/simplical complexity had a typo.
A couple of simple/simplicial examples:
A non-simple and non-simplicial case:
Note that the primal algorithm appears to be much better than our estimate. The reason is that the farther we go into the tree, the better the actual runtime will differ from the worst case scenario. I also find the runtimes quite counter-intuitive. It seems that obtaining the f-vector of a simple/simplicial polytope with this iterator is much better than using the h-vector method. |
comment:14
On the internal function, having it be an Thank you for the timings. I don't really have any intuition for what should be faster. So I won't be much help and will simply defer to your (and Yuan's) judgement. |
comment:16
Replying to @tscrim:
In #33646 I propose to use the keyword The problem with exponential size is the following: Given a polytope as finite intersection of closed halfspaces. The number of vertices can be expected to be exponential with respect to the number of facets. However, if you have a non-simple and non-simplicial polytope things might be a lot different. Those polytopes are less-generic but certainly more interesting. |
New commits:
|
This comment has been minimized.
This comment has been minimized.
Changed branch from u/gh-kliem/improved_edge_ridge_heuristic to public/33611 |
comment:18
In docstring of
|
comment:19
In the docstring of |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
Maybe change all |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:24
Regarding
Are the vertices and facets of a New commits:
|
comment:25
Replying to @yuan-zhou:
The order of Vrepresentation and Hrepresentation is taken from the input and is then fixed. |
comment:26
Thank you very much! All looks good to me. @tscrim: Would you mind taking a look at the Patchbot failing? (I don't understand it.) |
comment:27
At the moment there is only one failure and looks like a |
comment:29
Indeed, it is unrelated. The latest patchbot run also came back morally green as well. |
comment:30
Thank you. |
Changed branch from public/33611 to |
In #30040 we have improved the face iterator for simple/simplicial polytopes, but have not applied this to our heuristic, whether we should find edges/ridges in dual/non-dual mode.
This is noticeable for edges of the permutahedron (and theoretically also for other edges of simple polytopes) and does not make a difference otherwise.
Before:
After:
The heuristic isn't perfect, but if it fails, you can now select a better algorithm:
Depends on #33644
Depends on #33646
CC: @tscrim @yuan-zhou
Component: geometry
Author: Jonathan Kliem
Branch/Commit:
3bccc27
Reviewer: Travis Scrimshaw, Yuan Zhou
Issue created by migration from https://trac.sagemath.org/ticket/33611
The text was updated successfully, but these errors were encountered: