gpt4 book ai didi

algorithm - 凸包 : known number of points but not points itself

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:15:21 27 4
gpt4 key购买 nike

我需要找到一种算法,根据给定的一组大小为 n 的点 S 计算凸包。我知道 S 正好有 6 个点 构成了凸包。

最好和最有效的方法是什么?

我想从 S 生成所有可能的点组合(这将是 n 选择 6 个点)这将花费 O(n^6) 然后检查这是否是一个凸包,这会花费 O(n) 但会导致非常糟糕的总运行时间。一定会有更好的办法。有什么提示吗?

最佳答案

如果凸包上只有 6 个点,则 Jarvis March或者 Gift-wrapping 算法会非常有效。它在 O(nh) 时间内运行,其中 h 是凸包上的点数。

关于algorithm - 凸包 : known number of points but not points itself,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38241464/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com