  In the pairwise weighted spanner problem, the input consists of an
$n$-vertex-directed graph, where each edge is assigned a cost and a length.
Given $k$ vertex pairs and a distance constraint for each pair, the goal is to
find a minimum-cost subgraph in which the distance constraints are satisfied.
This formulation captures many well-studied connectivity problems, including
spanners, distance preservers, and Steiner forests.
  In the offline setting, we show:
  1. An $\tilde{O}(n^{4/5 + \epsilon})$-approximation algorithm for pairwise
weighted spanners. When the edges have unit costs and lengths, the best
previous algorithm gives an $\tilde{O}(n^{3/5 + \epsilon})$-approximation, due
to Chlamt\'a\v{c}, Dinitz, Kortsarz, and Laekhanukit (TALG, 2020).
  2. An $\tilde{O}(n^{1/2+\epsilon})$-approximation algorithm for all-pair
weighted distance preservers. When the edges have unit costs and arbitrary
lengths, the best previous algorithm gives an
$\tilde{O}(n^{1/2})$-approximation for all-pair spanners, due to Berman,
Bhattacharyya, Makarychev, Raskhodnikova, and Yaroslavtsev (Information and
Computation, 2013).
  In the online setting, we show:
  1. An $\tilde{O}(k^{1/2 + \epsilon})$-competitive algorithm for pairwise
weighted spanners. The state-of-the-art results are
$\tilde{O}(n^{4/5})$-competitive when edges have unit costs and arbitrary
lengths, and $\min\{\tilde{O}(k^{1/2 + \epsilon}), \tilde{O}(n^{2/3 +
\epsilon})\}$-competitive when edges have unit costs and lengths, due to
Grigorescu, Lin, and Quanrud (APPROX, 2021).
  2. An $\tilde{O}(k^{\epsilon})$-competitive algorithm for single-source
weighted spanners. Without distance constraints, this problem is equivalent to
the directed Steiner tree problem. The best previous algorithm for online
directed Steiner trees is $\tilde{O}(k^{\epsilon})$-competitive, due to
Chakrabarty, Ene, Krishnaswamy, and Panigrahi (SICOMP, 2018).
