The greedy geometric spanner is determined from an input consisting a set of points and a parameter
t
≥
1
{\displaystyle t\geq 1}
. The goal is to construct a graph whose shortest path distances are at most
t
{\displaystyle t}
times the geometric distances between pairs of points. It may be constructed by a greedy algorithm that adds edges one at a time to the graph, starting from an edgeless graph with the points as its vertices. All pairs of points are considered, in sorted (ascending) order by their distances, starting with the closest pair. For each pair
(
u
,
v
)
{\displaystyle (u,v)}
of points, the algorithm tests whether the graph constructed so far already contains a path from
u
{\displaystyle u}
to
v
{\displaystyle v}
with length at most
t
⋅
d
(
u
,
v
)
{\displaystyle t\cdot d(u,v)}
. If not,
the edge
u
v
{\displaystyle uv}
with length
d
(
u
,
v
)
{\displaystyle d(u,v)}
is added to the graph.
By construction, the resulting graph is a geometric spanner with stretch factor at most
t
{\displaystyle t}
.
A naive implementation of this method would take time
O
(
n
3
log
n
)
{\displaystyle O(n^{3}\log n)}
on inputs with
n
{\displaystyle n}
points. This is because the considerations for each of the
O
(
n
2
)
{\displaystyle O(n^{2})}
pairs of points involve an instance of Dijkstra's algorithm to find a shortest path in a graph with
O
(
n
)
{\displaystyle O(n)}
edges. It uses
O
(
n
2
)
{\displaystyle O(n^{2})}
space to store the sorted list of pairs of points. More careful algorithms can construct the same graph in time
O
(
n
2
log
n
)
{\displaystyle O(n^{2}\log n)}
, or in space
O
(
n
)
{\displaystyle O(n)}
.
A construction for a variant of the greedy spanner that uses graph clustering to quickly approximate the graph distances runs in time
O
(
n
log
n
)
{\displaystyle O(n\log n)}
in Euclidean spaces of any bounded dimension, and can produce spanners with (approximately) the same properties as the greedy spanners. The same method can be extended to spaces with bounded doubling dimension.
In Euclidean spaces of bounded dimension, for any constant
t
{\displaystyle t}
, the greedy geometric
t
{\displaystyle t}
-spanners on sets of
n
{\displaystyle n}
points have bounded degree, implying that they also have
O
(
n
)
{\displaystyle O(n)}
edges. This property does not extend even to well-behaved metric spaces: there exist spaces with bounded doubling dimension where the greedy spanner has unbounded vertex degree. However, in such spaces the number of edges is still
O
(
n
)
{\displaystyle O(n)}
.
Greedy geometric spanners in bounded-dimension Euclidean spaces also have total weight at most a constant times the total weight of the Euclidean minimum spanning tree.
This property remains true in spaces of bounded doubling dimension.
Das, Gautam (1990), Approximation Schemes in Computational Geometry (doctoral dissertation), University of Wisconsin, MR 2685391, OCLC 22935858 /wiki/Gautam_Das_(computer_scientist)
Althöfer, Ingo; Das, Gautam; Dobkin, David; Joseph, Deborah (1990), "Generating sparse spanners for weighted graphs", SWAT 90, Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 26–37, CiteSeerX 10.1.1.158.2241, doi:10.1007/3-540-52846-6_75, ISBN 978-3-540-52846-3, retrieved 2021-03-16 978-3-540-52846-3
Althöfer, Ingo; Das, Gautam; Dobkin, David; Joseph, Deborah; Soares, José (1993), "On sparse spanners of weighted graphs", Discrete & Computational Geometry, 9 (1): 81–100, doi:10.1007/BF02189308, MR 1184695 /wiki/Ingo_Alth%C3%B6fer
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing
Althöfer, Ingo; Das, Gautam; Dobkin, David; Joseph, Deborah; Soares, José (1993), "On sparse spanners of weighted graphs", Discrete & Computational Geometry, 9 (1): 81–100, doi:10.1007/BF02189308, MR 1184695 /wiki/Ingo_Alth%C3%B6fer
Bose, Prosenjit; Carmi, Paz; Farshi, Mohammad; Maheshwari, Anil; Smid, Michiel (2010), "Computing the greedy spanner in near-quadratic time", Algorithmica, 58 (3): 711–729, doi:10.1007/s00453-009-9293-4, MR 2672477, S2CID 8068690 /wiki/Jit_Bose
Alewijnse, Sander P. A.; Bouts, Quirijn W.; ten Brink, Alex P.; Buchin, Kevin (2015), "Computing the greedy spanner in linear space", Algorithmica, 73 (3): 589–606, arXiv:1306.4919, doi:10.1007/s00453-015-0001-2, MR 3411749, S2CID 253977471 /wiki/Algorithmica
Das, Gautam; Narasimhan, Giri (1997), "A fast algorithm for constructing sparse Euclidean spanners", International Journal of Computational Geometry and Applications, 7 (4): 297–315, doi:10.1142/S0218195997000193, MR 1460840 /wiki/Gautam_Das_(computer_scientist)
Gudmundsson, Joachim; Levcopoulos, Christos; Narasimhan, Giri (2002), "Fast greedy algorithms for constructing sparse geometric spanners", SIAM Journal on Computing, 31 (5): 1479–1500, doi:10.1137/S0097539700382947, MR 1936655 /wiki/SIAM_Journal_on_Computing
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing
Althöfer, Ingo; Das, Gautam; Dobkin, David; Joseph, Deborah; Soares, José (1993), "On sparse spanners of weighted graphs", Discrete & Computational Geometry, 9 (1): 81–100, doi:10.1007/BF02189308, MR 1184695 /wiki/Ingo_Alth%C3%B6fer
Chandra, Barun; Das, Gautam; Narasimhan, Giri; Soares, José (1995), "New sparseness results on graph spanners", International Journal of Computational Geometry and Applications, 5 (1–2): 125–144, doi:10.1142/S0218195995000088, MR 1331179 /wiki/Gautam_Das_(computer_scientist)
Das, Gautam; Heffernan, Paul; Narasimhan, Giri (1993), "Optimally sparse spanners in 3-dimensional Euclidean space", Proceedings of the Ninth Annual Symposium on Computational Geometry (SoCG '93), New York, NY, USA: ACM, pp. 53–62, doi:10.1145/160985.160998 /wiki/Gautam_Das_(computer_scientist)
Das, Gautam; Narasimhan, Giri (1997), "A fast algorithm for constructing sparse Euclidean spanners", International Journal of Computational Geometry and Applications, 7 (4): 297–315, doi:10.1142/S0218195997000193, MR 1460840 /wiki/Gautam_Das_(computer_scientist)
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing
Har-Peled, Sariel; Mendel, Manor (2006), "Fast construction of nets in low-dimensional metrics and their applications", SIAM Journal on Computing, 35 (5): 1148–1184, doi:10.1137/S0097539704446281, MR 2217141, S2CID 37346335 /wiki/Sariel_Har-Peled
Smid, Michiel H. M. (2009), "The weak gap property in metric spaces of bounded doubling dimension", in Albers, Susanne; Alt, Helmut; Näher, Stefan (eds.), Efficient Algorithms: Essays Dedicated to Kurt Mehlhorn on the Occasion of His 60th Birthday, Lecture Notes in Computer Science, vol. 5760, Springer, pp. 275–289, doi:10.1007/978-3-642-03456-5_19 /wiki/Susanne_Albers
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing
Chandra, Barun; Das, Gautam; Narasimhan, Giri; Soares, José (1995), "New sparseness results on graph spanners", International Journal of Computational Geometry and Applications, 5 (1–2): 125–144, doi:10.1142/S0218195995000088, MR 1331179 /wiki/Gautam_Das_(computer_scientist)
Das, Gautam; Heffernan, Paul; Narasimhan, Giri (1993), "Optimally sparse spanners in 3-dimensional Euclidean space", Proceedings of the Ninth Annual Symposium on Computational Geometry (SoCG '93), New York, NY, USA: ACM, pp. 53–62, doi:10.1145/160985.160998 /wiki/Gautam_Das_(computer_scientist)
Das, Gautam; Narasimhan, Giri (1997), "A fast algorithm for constructing sparse Euclidean spanners", International Journal of Computational Geometry and Applications, 7 (4): 297–315, doi:10.1142/S0218195997000193, MR 1460840 /wiki/Gautam_Das_(computer_scientist)
Filtser, Arnold; Solomon, Shay (2016), "The greedy spanner is existentially optimal", Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing (PODC '16), New York, NY, USA: ACM, pp. 9–17, arXiv:1605.06852, doi:10.1145/2933057.2933114, S2CID 7229289 /wiki/Symposium_on_Principles_of_Distributed_Computing