Asking whether an edge already exists scanned the whole edge list, so building a graph of E edges cost O(E^2). A visibility sweep adds a quadratic number of edges, so the whole construction was cubic: 600 satellites took twelve seconds. An index of outgoing edge positions makes the membership test constant time, and the same index answers neighbours and out-degree without a scan. Removal rebuilds the index in one pass, since it renumbers every later position. Six hundred satellites now take 130 ms, a factor of ninety five. |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||