We present an algorithm for computing the so-called Beer-index of a polygon $P$ in $O(n^2)$ time, where $n$ is the number of corners. The polygon $P$ may have holes. The Beer-index is the probability that two points chosen independently and uniformly at random in $P$ can see each other. Given a finite set $M$ of $m$ points in a simple polygon $P$, we also show how the number of pairs in $M$ that see each other can be computed in $O(n\log n+m^{4/3}\log^\alpha m\log n)$ time, where $\alpha<1.78$ is a constant. We likewise study the problem of computing the expected geodesic distance between two points chosen independently and uniformly at random in a simple polygon $P$. We show how the expected $L_1$-distance can be computed in optimal $O(n)$ time by a conceptually very simple algorithm. We then describe an algorithm that outputs a closed-form expression for the expected $L_2$-distance in $O(n^2)$ time.
翻译:我们提出了一个计算所谓的啤酒指数的算法, 以美元计多边形美元, 美元是角数。 多边形美元可能有洞。 啤酒指数是两个点单独选择并以随机统一方式以美元随机选择的概率。 在一个简单的多边形美元中, 我们用一个有限设定的以美元计点, 以美元计点, 以美元计点, 以美元计点, 以美元计点, 以美元计点, 以美元计点数, 以美元计点数, 以美元计点数, 以美元计数, 以美元计数为美元计点数。 我们然后描述一个算法, 以美元计数方式计算出一个以美元计值为美元=2美元( 美元) 的封闭式表达方式, 以美元计数。