Skip to content

Incorrect volume calculation when H-rep contains redundant inequalities #249

@maxkapur

Description

@maxkapur

I have a function that generates a bunch of polyhedra and computes their volume. All of the polyhedra are bounded by [0,1] in all variables (hence, their volume is finite and less than one), and I add additional constraints according to a certain rule. Sometimes, one of these constraints is completely redundant, and in such cases, volume() returns an overestimate of the volume.

MWE:

using Polyhedra

poly = polyhedron(HalfSpace([-1.0, 0.0], 0.0) 
                  HalfSpace([0.0, -1.0], 0.0) 
                  HalfSpace([1.0, 0.0], 1.0) 
                  HalfSpace([0.0, 1.0], 1.0) 
                  HalfSpace([-0.2, -0.8], -0.0) 
                  HalfSpace([0.6, 0.4], 0.6))

volume(poly)
# 1.1666666666666665

The vertices of this polyhedron, as correctly given by vrep(poly), are

 [ 1/3 , 1 ]
 [ 1   , 0 ]
 [ 0   , 0 ]
 [ 0   , 1 ]

and a simple sketch shows that the true area is 2/3.

  • Polyhedra version: 0.6.13
  • Julia version: 1.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions