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

Faster box approximation of VPolytope #1769

Closed
schillic opened this issue Oct 11, 2019 · 0 comments · Fixed by #2252
Closed

Faster box approximation of VPolytope #1769

schillic opened this issue Oct 11, 2019 · 0 comments · Fixed by #2252
Assignees
Labels
performance 🐎 More efficient code

Comments

@schillic
Copy link
Member

schillic commented Oct 11, 2019

The box approximation from a vertex representation can be computed more efficiently than evaluating the support function in all 2n directions on all m vertices. The idea is to create the box incrementally: Start with the first vertex and then extend the bounds for each new vertex.

low = copy(vertices[1])
high = copy(vertices[1])
for v in vertices[2:m]
    for i in 1:n
        if v[i] < high[i]
            high[i] = v[i]
        elseif v[i] > low[i]
            low[i] = v[i]
        end
    end
end
return Hyperrectangle(low=low, high=high)

The crucial part is the elseif: If a vertex extends the upper bound in dimension i, it cannot extend the lower bound in the same dimension.

In fact, this idea generalizes to parallelotopes with fixed directions.

@schillic schillic added the performance 🐎 More efficient code label Oct 11, 2019
@schillic schillic self-assigned this Jul 20, 2020
schillic added a commit that referenced this issue Oct 27, 2020
#1769 - Faster box approximation of VPolytope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🐎 More efficient code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant