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

Compute graph of polyhedron with CombinatorialPolyhedron #28626

Closed
kliem opened this issue Oct 18, 2019 · 25 comments
Closed

Compute graph of polyhedron with CombinatorialPolyhedron #28626

kliem opened this issue Oct 18, 2019 · 25 comments

Comments

@kliem
Copy link
Contributor

kliem commented Oct 18, 2019

We use CombinatorialPolyhedron to compute the graph of Polyhedron_base.

In the case of polyhedra with lines aka unpointed polyhedra this changes the behavior:

  • Old behavior: The vertex graph basically ignored the lines, so that
sage: P = Polyhedron(vertices=my_vertices, rays=my_rays, lines=my_lines)
sage: Q = Polyhedron(vertices=my_vertices, rays=my_rays)

have the same graph (assuming the Vrepresentation as ['my_vertices', 'my_rays', 'my_lines'] is minimal).

  • New behavior: The vertex graph of a polyhedron with lines contains no vertices as the polyhedron as no vertices.

We add information about this to the documentation of vertex_graph.

We alter a doctest in combinatorial_automorphism_group that assumed the old behavior.

See https://groups.google.com/d/msg/sage-devel/lTwb_P0nBEw/_R4vXOxgDAAJ for the discussion of this change.

Depends on #28621
Depends on #28603

CC: @jplab @LaisRast

Component: geometry

Keywords: polyhedron, combinatorial_polyhedron

Author: Jonathan Kliem

Branch/Commit: 01d1907

Reviewer: Dima Pasechnik, Jean-Philippe Labbé

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

@kliem kliem added this to the sage-9.0 milestone Oct 18, 2019
@kliem
Copy link
Contributor Author

kliem commented Oct 18, 2019

Changed dependencies from #28621 to #28621, #28603

@kliem
Copy link
Contributor Author

kliem commented Oct 18, 2019

Branch: public/28626

@kliem
Copy link
Contributor Author

kliem commented Oct 18, 2019

Changed keywords from none to polyhedron, combinatorial_polyhedron

@kliem
Copy link
Contributor Author

kliem commented Oct 18, 2019

Commit: fe09784

@kliem
Copy link
Contributor Author

kliem commented Oct 18, 2019

comment:2

What do we do with polyhedra that contain lines?

As of now it is understood that in this case the vertex_graph is non-empty. So the vertex graph is basically the one of the projection.

However, the docstring of vertex_graph states that the edges correspond to edges of the polyhedron. I find it very confusing that the vertex_graph of an unpointed polyhedron should have edges.

If people think this is the way it should be than the docstring of vertex_graph should be more precise.

I stumbled upon this because I got a test failure at
File "src/sage/geometry/polyhedron/base.py", line 7229

7225         Permutations can only exchange vertices with vertices, rays
7226         with rays, and lines with lines::
7227 
7228             sage: P = Polyhedron(vertices=[(1,0,0), (1,1,0)], rays=[(1,0,0)], lines=[(0,0,1)])
7229             sage: P.combinatorial_automorphism_group(vertex_graph_only=True)
7230             Permutation Group with generators [(A vertex at (1,0,0),A vertex at (1,1,0))]

This is a weird test, as it tests a behavior which seems to be opposed to the intention of vertex_graph. Also the announcement is strange, as the vertex_graph contains neither rays nor lines and thus will not interchange them (not even a ray with a ray).


New commits:

b89610eadded combinatorial polyhedron as an attribute for polyhedra
a005e47added vertex_graph, deprecated edge_graph
96346faimproved deprecation warning
4b83abedeprecation warning gives new name
ecb7986changed stacklevel to 3, so deprecation warning shows during normal usage
767eb74Merge branch 'public/28603' of git://trac.sagemath.org/sage into public/28626
fe09784calculate vertex_graph using combinatorialpolyhedron

@dimpase
Copy link
Member

dimpase commented Oct 19, 2019

comment:3

it is not clear from the ticket description why edge_graph is deprecated, can you explain?

@kliem
Copy link
Contributor Author

kliem commented Oct 19, 2019

comment:4

Sorry about the confusion. This ticket is built on top of #28603 and #28621. Only the last commit is due to this ticket.

In CombinatorialPolyhedron, I chose to implement a method edge_graph. In order to make it more compatible with Polyhedron I replace it by vertex_graph in #28603.

This way CombinatorialPolyhedron(P).vertex_graph() gives the vertex graph of our polyhedron P.

There are two issues with edge graph:

  • It has no vertices if there are no edges (a 0-dimensional polyhedron).
  • It depends not just on the combinatorial type, for example those two
sage: Q = Polyhedron(vertices=[[1,0],[0,1]],rays=[[1,11/10],[11/10,1]]); Q
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2 vertices and 2 rays
sage: P = Polyhedron(vertices=[[1,0],[0,1]],rays=[[1,1]]); P
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2 vertices and 1 ray

polyhedra do not have isomorphic edge_graphs in CombinatorialPolyhedron.

@dimpase
Copy link
Member

dimpase commented Oct 19, 2019

comment:5

So this does bring the sanity in, where vertices correspond to vertices in the geometric sense, right?

@kliem
Copy link
Contributor Author

kliem commented Oct 20, 2019

comment:6

Yes.

However, as I'm changing the behavior, I didn't want to do it secretely and see if there are objections. Hence the post on sage_devel.

@dimpase
Copy link
Member

dimpase commented Oct 20, 2019

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Oct 20, 2019

comment:7

Are you still working on the ticket, or it needs review?

@kliem
Copy link
Contributor Author

kliem commented Oct 20, 2019

comment:8

I mostly waited, if there where objections to changing the behavior.

If there are none, I need to change the failing test and probably comment on the vertices being different from the method vertices.

@kliem

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 21, 2019

Changed commit from fe09784 to 01d1907

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 21, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

5e7f291more documentation to vertex_graph
01d1907modified test vertex graph of polyhedron with lines in combinatorial_automorphism_group

@embray
Copy link
Contributor

embray commented Jan 6, 2020

comment:12

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-9.0, sage-9.1 Jan 6, 2020
@kliem
Copy link
Contributor Author

kliem commented Jan 25, 2020

comment:13

Is this ticket good to go?

@dimpase
Copy link
Member

dimpase commented Jan 25, 2020

comment:14

How about the bot report:

========== pyflakes ==========
git checkout patchbot/ticket_merged
src/sage/geometry/polyhedron/base.py:5189: local variable 'ambient_dim' is assigned to but never used
src/sage/geometry/polyhedron/base.py:5190: local variable 'polytope_dim' is assigned to but never used

@jplab
Copy link

jplab commented Feb 4, 2020

comment:15

Replying to @dimpase:

How about the bot report:

========== pyflakes ==========
git checkout patchbot/ticket_merged
src/sage/geometry/polyhedron/base.py:5189: local variable 'ambient_dim' is assigned to but never used
src/sage/geometry/polyhedron/base.py:5190: local variable 'polytope_dim' is assigned to but never used

Fixed in #28880.

@mkoeppe
Copy link
Member

mkoeppe commented Apr 14, 2020

comment:16

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 14, 2020
@jplab
Copy link

jplab commented Apr 20, 2020

comment:17

Replying to @kliem:

Yes.

However, as I'm changing the behavior, I didn't want to do it secretely and see if there are objections. Hence the post on sage_devel.

Could you link to the post?

I would say that the ticket looks ready, but for the sake of completeness, I would like to check the change of behavior...

@jplab
Copy link

jplab commented Apr 20, 2020

Changed reviewer from Dima Pasechnik to Dima Pasechnik, Jean-Philippe Labbé

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Apr 20, 2020

comment:20

Thank you.

@vbraun
Copy link
Member

vbraun commented Apr 23, 2020

Changed branch from public/28626 to 01d1907

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

6 participants