Skip to content

Polytope volume function engines produce different results #16045

@sagetrac-wishcow

Description

@sagetrac-wishcow

The volume currently does not distinguish between ambient and induced volume. This should be changed.

Different engine yield very different results, and example:
The lrs engine for polytope volume calculates volume respective to the dimension of the polytope,
while the auto engine calculates volume respective to the dimension of the ambient space.

Example:

m3 = matrix(ZZ, [[0,0,0],[0,0,1]])
p = Polyhedron(m3)
p.volume(engine="lrs")
p.volume()

1.0
0

(Note: The lrs allows calculation of volumes of facets without reducing the dimension of the ambient space, but it uses non-isometrical projections!)

The suggested resolution adds a parameter measure that essentially behaves as follows:

sage: P = Polyhedron([[0, 0], [1, 1]])
sage: P.volume()
0
sage: P.volume(measure='induced')                                                                                                                                   
sqrt(2)
sage: P.volume(measure='induced_rational') # optional -- latte_int
1

Depends on #20887
Depends on #22804

CC: @sagetrac-jakobkroeker @mkoeppe @videlec @jplab @mforets @mo271 @seblabbe

Component: geometry

Keywords: polytope, volume, lrs_volume, days88

Stopgaps: wrongAnswerMarker

Author: Moritz Firsching

Branch/Commit: f5d47cf

Reviewer: Jean-Philippe Labbé

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions