Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit773b4bc

Browse files
Update src/geometry/nearest_points.md
Replace "cube" with "square"Co-authored-by: Oleksandr Kulkov <adamant.pwn@gmail.com>
1 parent4ce3c84 commit773b4bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/geometry/nearest_points.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ An alternative method arises from a very simple idea to heuristically improve th
176176
We will consider only the squares containing at least one point. Denote by $n_1, n_2, \dots, n_k$ the number of points in each of the $k$ remaining squares. Assuming at least two points are in the same or in adjacent squares, the time complexity is $\Theta\left(\sum\limits_{i=1}^k n_i^2\right)$.
177177

178178
??? info "Proof"
179-
For the $i$-th square containing $n_i$ points, the number of pairs inside is $\Theta(n_i^2)$. If the $i$-th square is adjacent to the $j$-th square, then we also perform $n_i n_j \le \max(n_i, n_j)^2 \le n_i^2 + n_j^2$ distance comparisons. Notice that eachcube has at most $8$ adjacentcubes, so we can bound the sum of all comparisons by $\Theta(\sum_{i=1}^{k} n_i^2)$. $\quad \blacksquare$
179+
For the $i$-th square containing $n_i$ points, the number of pairs inside is $\Theta(n_i^2)$. If the $i$-th square is adjacent to the $j$-th square, then we also perform $n_i n_j \le \max(n_i, n_j)^2 \le n_i^2 + n_j^2$ distance comparisons. Notice that eachsquare has at most $8$ adjacentsquares, so we can bound the sum of all comparisons by $\Theta(\sum_{i=1}^{k} n_i^2)$. $\quad \blacksquare$
180180

181181
Now we need to decide on how to set $d$ so that it minimizes $\Theta(\sum_{i=1}^{k} n_i^2)$.
182182

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp