# cartesian product polyhedra Anonymous

Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:

P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()


The output is:

A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)

edit retag close merge delete

The question is asking if there is any reference for the computation that Sage is making.

Which is the code doing the computation, for instance for the cartesian product of the following object X with itself?

ie = lambda s: [ [1,s,0,0], [1,0,s,0], [1,0,0,s] ]
X = Polyhedron( ieqs = ie(1)+ie(-1) )


Is this X in the right (polyhedron base) class?!

To the orignal poster: please provide an example of the computation you are asking about. This makes it way easier to explore a question, thereby increasing chances of an answer.

Thanks for updating your question, now i think/hope i understand what you are asking for.

Sort by » oldest newest most voted

No reference is given within Sage source code. To access its source code, you just have to add a double question mark on method as follows:

sage: P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
sage: P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
sage: P1.product??


You will first see the documentation of the method, and then the program. As you will see, this part of Sage is written in pure Python and is very readable. Moreover, the construction seems straightforward: vertices, rays and lines are processed independenltly. If you have any problem in understanding a particular point of the code, please do not hesitate to ask.

more

For a reference on the product of polyhedra, see p.390 in the Handbook of Discrete and Computational Geometry, Chapter 15:

https://www.csun.edu/~ctoth/Handbook/...

Which is the reference which Sage tries to follow for nomenclature.