1 Introduction
A spanner of a given graph is a subgraph which approximately preserves lengths of shortest paths in , up to some prescribed error (e.g., multiplicative or additive). Given an undirected graph with vertices and , a subgraph is an additive spanner of if for every pair of vertices , where denotes the length of the shortest  path in . This problem has been widely studied for unweighted graphs [3]. Aingworth et al. [4] show that all graphs have additive spanners containing edges. Chechik [7] and Baswana et al. [5] show that all graphs have 4additive and 6additive spanners containing and edges, respectively. More recently, Abboud and Bodwin [1] show that the tradeoff between the size of a spanner and the allowed error cannot be extended  specifically, for , one cannot even compress graphs into bits so that distances can be recovered with additive error.
Similarly, a subgraph is called a pairwise additive spanner of with respect to vertex pairs if distances are approximately additively preserved for all vertex pairs in , that is, for every pair of vertices . If for some , then is called a subsetwise additive spanner of with respect to . Cygan et al. [8] give polynomial time algorithms to compute subsetwise and pairwise additive spanners for unweighted graphs, and show that there exists a pairwise spanner of size . They also show how to construct size subsetwise 2additive spanners. Abboud et al. [2] improved this result by showing how to construct size subsetwise 2additive spanners. Kavitha [9] shows that there is a polynomial time algorithm which constructs pairwise spanners of size and for and , respectively.
1.1 Our Contributions
In Section 2, we first show that every subset of demands in an vertex graph has a additive spanner on edges where is a constant. We then show that for every set with vertex demand pairs, there are pairwise  and spanners on and edges respectively. We also show that for every set , there is a spanner on edges where is a constant. We then show that every graph has additive  and spanners on and edges respectively. Finally, in Section 3, we show that every graph has an additive spanner on edges where is a constant.
2 Pairwise and Subsetwise Additive Spanners
To prove the results of pairwise spanners we rely on some properties of monotone circuits and monotone constraint satisfaction problems. Hence, we first provide the definitions of these objects from [6].
Definition 1 ([6, page 1])
(Monotone Circuits). A satisfiable monotone circuit with input wires and a single output wire is one with the following properties. We say satisfies if the output is true when inputs are set to true and to false.

(Monotone) If and satisfies , then also satisfies .

(Satisfiable) satisfies .
Definition 2 ([6, page 1])
(Monotone Constraint Satisfaction Problems (MCSPs)). A monotone constraint satisfaction problem (MCSP) is a finite set of satisfiable monotone circuits (called constraints), all with the same number of input wires labeled with . We say that satisfies if it satisfies every .
We now use the definition of the energy cost of MCSP from [6] as follows:
Definition 3 ([6, page 1])
(Energy Cost). The energy cost of an MCSP is the quantity
To discuss extremal problems, we also need the definition of MCSP Complex:
Definition 4 ([6, page 1])
(MCSP Complex). An MCSP complex is a nonempty set of MCSPs closed under subsets; that is, if and , then .
Definition 5 ([6, page 1])
(eec). The extremal energy cost of an MCSP complex is the function
where is a nonnegative integer.
Let us relate the above framework with the weighted additive spanner problem we discuss in this paper. There are input wires corresponding to the possible edges of an node graph. In the pairwise spanner problem, we are given demand pairs, and we want to preserve the distance between each pair with a given error bound (e.g. ). There are constraints, where each one encodes the condition for one demand pair . Here is the subgraph that has an edge iff the corresponding input wire is turned on and also that edge is present in . The energy cost of this MCSP is exactly the least possible number of edges in a pairwise spanner. We use the following lemma of MCSP complex in our results, which provides a bound for .
Lemma 1 ( [6, page 2])
Let be an MCSP complex, let be parameters, and let be an absolute constant. Suppose that for , there exist inputs satisfying either of the following two properties:

satisfies at least a constant fraction of the constraints in and , or

satisfies and .
Then
The following auxiliary lemma will be useful. Define a initialization of an unweighted graph to be a subgraph obtained by arbitrarily choosing edges incident to each vertex in and including them in , or choosing all edges incident to a vertex if its degree is at most (this simplifying technique was first used in [10]).
Lemma 2 ([7])
If is a initialization of an undirected unweighted graph , and there is a shortest path in that is missing edges in , then there are total vertices adjacent in to any vertex in .
For weighted graphs, we have to choose the edges in increasing order to get a useful bound from the initialization. Define a initialization of a weighted graph similarly, with the additional rule that the edges chosen incident to each vertex are the lightest (least weight) edges. We now have the following lemma which provides a similar bound as in Lemma 2 for weighted graphs.
Lemma 3
If is a initialization of an undirected weighted graph , and there is a shortest path in that is missing edges in , then there are total vertices adjacent in to any vertex in .
Proof
Let be a shortest path, let be the set of edges in currently missing in the spanner, and let us consider these edges to be oriented, so in means that and . Suppose a node in is adjacent to two first nodes of edges in respectively. Let be the edges in that come between in . Then we prove the inequality . (Here denotes the weight of the edge .)
The length of the subpath is . The length of the subpath of the shortest path is at least (since by definition it includes the edges ). Hence, we have the inequality since is a shortest path. We then observe that and , because in the initialization step we apparently chose to add edges to the spanner but not the edges . Hence, .
Let us say that an edge in is preheavy if its weight is greater than or equal to the sum of the previous two edges in , or postheavy if its weight is greater than or equal to the sum of the following two edges in . We now show that either a constant (greater than zero) fraction of the edges in are not preheavy, or a constant (greater than zero) fraction of the edges in are not postheavy (or both). If there are ever two preheavy edges in a row, this implies a rising sequence of length 3 of edges of increasing weight (when the edges in M are considered in order of their appearance in ). Thus these edges do not define two postheavy edges in a row. Hence, at least of the edges in M are not both preheavy and postheavy, and thus by an intersection bound we can’t have greater than or equal tp 5/6 fraction of the edges being preheavy and simultaneously a greater than or equal to 5/6 fraction of the edges being postheavy.
Let us assume without loss of generality that a constant fraction of edges in are not preheavy; call this subset (in the other case, just reverse the roles of s and t). If there does not exist a node adjacent to more than one first nodes in , then there are greater than or equal to nodes in the spanner adjacent to the first node of . Note that a node can not be adjacent to more than two first nodes in . The reason is because, if a node is adjacent to greater than or equal to three nodes in , then the inequality implies that the last such node in fact belongs to a preheavy edge.
Cygan et al. [8] provided a subsetwise 2additive spanner for unweighted graphs. Unfortunately there is no straightforward extension of the algorithm for weighted graphs. The algorithm has two steps: clustering phase and path buying phase. In the clustering phase, we continuously select a vertex with at least neighbors. Then we form a cluster with vertices and add all the edges in the spanner that are between two vertices in the cluster of between a vertex of the cluster and the center of the cluster. When there are no more vertices with at least neighbors, we add all the unclustered vertices and adjacent edges to the spanner. This clustering phase has two properties:

(missingedge property) If an edge is absent in the spanner, then and belong to two different clusters.

(clusterdiameter property) The distance in the spanner between any two vertices of the same cluster is at most .
The reason why the trivial extension does not work for the weighted case is because it relies on the following lemma.
Lemma 4 ([8, page 4])
If the shortest path in between any two nodes contains edges that are absent in the clustered graph, then there are at least clusters having at least one vertex on .
The claim is true for unweighted scenario, because a shortest path can go through a cluster at most two times. If it visits a cluster more than two times then it can not be a shortest path. However for the weighted scenario a shortest path can visit a cluster more than twice. For the weighted scenario we have the following lemma:
Lemma 5
If the shortest path in between any two nodes contains edges that are absent in the clustered graph, then there are at least clusters having at least one vertex on .
Proof
If we take an edge form these absent edges, then we know that is connected to two vertices of different clusters by the missingedge property. We generate two pairs for each absent edge and say that the pair is associated with a cluster if . We can generate exactly pairs from edges. We now count the minimum number of clusters that can be associated with these pairs. We first notice that can not traverse a cluster more than times. Because every time enters and exits, it has to use at least two edges. For traversing times it needs at least edges. It can not take more than edges because according the clusterdiameter property if it takes more than edges then it can not be a shortest path. Hence, a cluster can be associated with at most pairs and the number of clusters that has at least one vertex of is at least .
We now take the graph from the clustering phase and add some additional edges to make it a additive spanner. We consider all the shortest paths among all pairs of vertices in the subset. We than add the edges (that are not already in ) of a shortest path if we find that shortest path useful. By useful we mean that the added edges will increase the connectivity among the clusters with out paying that much cost. We now formally define the cost of a path and the benefit/value we gain by adding that path. We define as the number of missing edges in . And we define equal to the number of clusters that have two properties. The first property is has at least one vertex in the considered cluster. Let be the endpoints of . The second property is the cluster has to contribute pairs like such that where . The total number of such pairs is denoted by . We consider each shortest path among the pairs of vertices in the subset and add it in if .
Lemma 6
For any .
Proof
Let be the shortest path between and . The claim is trivially true if . If , then let the number of edges absent in from be equal to . Then there is at least clusters traversed by . Note that all of these clusters can not contribute to because then . But if there is at least one cluster that does not contribute to then by the clusterdiameter property the claim is true.
Theorem 1
For such that and is a constant, the graph contains edges.
Proof
The clustering phase does not give us more than edges. Hence, we count the number of edges we get from the pathbuying phase. Let be the set of shortest paths that we added in the later phase. The number of edges added is equal to . However, is no more than . We now count the number of pairs that contributes in for some . For each pair we take at most edges in the pathbuying phase. According to the obervation of Cygan et al. [8], if is a constant, a cluster can not contribute more than times because of the cluster diameter property. The total number of pairs is equal to since, the vertex and the number of cluster is . Hence, total number of edges added is equal to .
Corollary 1
Every subset of demands in an node graph has a additive spanner on edges where is a constant.
We now provide another way to compute additive spanner which has the slightly larger size bound compared to the above algorithm. However, it does not assume that is a constant.
Theorem 2
Every set of demand pairs in an node graph has a pairwise spanner on edges.
Proof
We apply Lemma 1 with . Let be parameters, and let the spanner be a initialization of . Hence, has less than or equal to edges. We say that a demand pair is short if its shortest path is currently missing less than or equal to edges in the spanner, or long otherwise.

To handle the short pairs , we add the missing edges of a shortest path to the spanner. The number of edges added in this phase is no more than .

To handle the long pairs , randomly sample a set of nodes
by including each node independently with probability
. Add to the spanner a shortest path tree rooted at each . The expected number of edges added in this phase is . By Lemma 3 there are nodes adjacent to the shortest path, so with constant probability or higher, we sample a node adjacent to a node on this shortest path. In this event, we compute:triangle inequality triangle inequality
Letting denote the final spanner, which satisfies at least a constant fraction of all demand pairs in expectation, setting and we have
Kavitha [9] shows that there is a polynomial time algorithm which constructs pairwise 4 additive spanners of size . We now show that there is a polynomial time algorithm which constructs pairwise additive spanners of size .
Theorem 3
Every set of demand pairs in an node graph has a additive spanner on edges.
Proof
We apply Lemma 1 with . Let be parameters, and let the spanner be a initialization of . Hence, the number of edges is less than or equal to . This time there are three cases: a demand pair is short if its shortest path is missing less than or equal to edges, it is medium if it is not short but its shortest path is missing less than or equal to edges, or it is long otherwise.

To handle the short pairs , add the missing edges of the shortest path to the spanner. The number of edges added is less than or equal to .

To handle the long pairs , randomly sample a set of nodes by including each node independently with probability , and add the edges of a BFS tree rooted at each to the spanner. The total number of edges added is equal to . By Lemma 3 there are nodes adjacent to the shortest path, so with constant probability or higher we sample a node adjacent to a node on this path. In this event, we compute:
triangle inequality triangle inequality 
There are two steps to handle the medium pairs . First, add the first and last missing edges in the shortest path to a spanner. The total number of edges added in this step is no more than . Then, randomly sample a set of nodes by including each node independently with probability . For each pair of nodes , check to see if there exist nodes adjacent to (respectively) in the current spanner such that the shortest path is missing less than or equal to edges. If so, then choose nodes with this property minimizing , and add all missing edges in the shortest path to the spanner. If not, do nothing. This part costs
edges in total. For a medium demand pair , by Lemma 3 there are nodes adjacent to the added prefix, suffix respectively, so with constant probability or higher we sample nodes adjacent to nodes on the added prefix, suffix respectively. In this event, note that there are less than or equal to missing edges on the shortest path, since are on the shortest path and is a medium pair (this step implicitly uses that shortest path tie breaking is consistent, so the shortest path is contained in the shortest path). Thus we do indeed add a shortest path corresponding to the pair , instead of the case where we do nothing. Say this added path is between nodes adjacent to respectively. Then we compute:
triangle inequality
Letting denote the final spanner, which satisfies a constant fraction of all demand pairs, setting and we have
which completes the proof.
Theorem 4
Every set of demand pairs in an node graph has a additive spanner on edges where is a constant.
Proof
We apply Lemma 1 with (second case not used). The proof is similar to that of previous theorems. Let be parameters, and let the spanner be a initialization of . Hence, the number of edges is less than or equal to . A demand pair is short if the shortest path is missing less than or equal to edges in the spanner, or long otherwise.

To handle the short pairs , add the missing edges of the shortest path to the spanner. The number of edges added is less than or equal to .

To handle the long demand pairs , there are two steps. First, add the first and last missing edges of the shortest path to the spanner. The number of edges added is less than or equal to . Then, randomly sample a set by including each node with probability and using Theorem 1 add a pairwise spanner on demand pairs ; this costs
edges. By Lemma 3 the added prefix and suffix of the shortest path each have adjacent nodes. Thus, with constant probability or higher, we sample such that is adjacent to in the added prefix and is adjacent to in the added suffix. In this event we can compute:
triangle inequality triangle inequality added prefix/suffix triangle inequality
Letting denote the final spanner, which satisfies at least a constant fraction of all demand pairs in expectation, setting and we have
which completes the proof.
3 Allpairs Additive Spanners
Allpairs additive spanners have been studied for unweighted graphs. There exists algorithms to compute 2, 4, and 6 additive spanners on and edges respectively [4, 7, 5]. In this section, we prove analogs for weighted graphs. To prove these results we use the following lemma from [6].
Lemma 7 ([6, page 3])
For an MCSP complex , let
Then for all we have .
In other words the value of increases as increases. And after that, the value does not increase anymore. The parameter range where is called the saturated regime. Lemma 7 provides a way to relate the pairwise spanners with allpairs spanners. For example, the pairwise bound of provided in Theorem 2 for additive spanners enters the saturated regime when [4]. Hence, Lemma 7 implies the bound of edges for allpairs spanners. We can provide similar arguments for and additive allpairs spanners. Hence, we have the following theorems.
Theorem 1
Every node graph has a additive spanner on edges.
Proof
Theorem 2
Every node graph has a additive spanner on edges.
Proof
Theorem 3
Every node graph has a additive spanner on edges where is a constant.
4 Conclusions and Open Problems
We have shown that every node graph has a subsetwise spanner on edges where and is a constant. We then show that for every set with vertex demand pairs, there are pairwise  and spanners on and edges respectively. We have also shown that for every set , there is a spanner on edges where is a constant. We then showed that every graph has additive  and spanners on and edges respectively. Finally, we have shown that every graph has an additive spanner on edges where is a constant. One natural question is: are the results tight (when is constant or not)? Another point is, the bound we have given is about the number of edges, but not how close to optimal solution it is. Finally, can the results be generalized to the multilevel version?
References
 [1] (2015) The 4/3 additive spanner exponent is tight. External Links: arXiv:1511.00700 Cited by: §1.
 [2] (2016) Lower bound amplification theorems for graph spanners. In Proceedings of the 27th ACMSIAM Symposium on Discrete Algorithms (SODA), pp. 841–856. Cited by: §1.
 [3] (2019) Graph spanners: a tutorial review. arXiv preprint arXiv:1909.03152. Cited by: §1.

[4]
(199904)
Fast estimation of diameter and shortest paths (without matrix multiplication)
. SIAM J. Comput. 28, pp. 1167–1181. External Links: Document Cited by: §1, §3, §3.  [5] (2010) Additive spanners and (, )spanners. ACM Transactions on Algorithms (TALG) 7 (1), pp. 5. Cited by: §1, §3.
 [6] (2020) Some general structure for extremal sparsification problems. arXiv preprint arXiv:2001.07741. Cited by: §2, §2, §3, Definition 1, Definition 2, Definition 3, Definition 4, Definition 5, Lemma 1, Lemma 7.
 [7] (2013) New additive spanners. In Proceedings of the twentyfourth annual ACMSIAM symposium on Discrete algorithms, pp. 498–512. Cited by: §1, §3, Lemma 2.
 [8] (2013) On pairwise spanners. In 30th International Symposium on Theoretical Aspects of Computer Science (STACS 2013), N. Portier and T. Wilke (Eds.), Leibniz International Proceedings in Informatics (LIPIcs), Vol. 20, Dagstuhl, Germany, pp. 209–220. External Links: ISBN 9783939897507, ISSN 18688969, Link, Document Cited by: §1, §2, Lemma 4, Proof.
 [9] (20171101) New pairwise spanners. Theory of Computing Systems 61 (4), pp. 1011–1036. External Links: ISSN 14330490, Document, Link Cited by: §1, §2.
 [10] (2014) Additive spanners: a simple construction. In Scandinavian Workshop on Algorithm Theory, pp. 277–281. Cited by: §2.