Изменения
→Построение BSP-дерева
<tex>
\mathrm{dist}(s_i,\ s_j) = \left\{\begin{array}{llcl}
|\{s\ \mathrm{between}\ s_i\ \mathrm{and}\ s_j \mid l(s_i) \cap s_j s \ne \varnothing \}| & \mathrm{if}\ l(s_i) \cap s_j \ne \varnothing \\
\infty & \mathrm{otherwise} \\
\end{array}\right.