Source author record

Ofer Neiman

Ofer Neiman appears in the imported research catalog. Authorship, coauthor and topic links are available while profile ownership is still unclaimed.

ResearcherUnclaimed source record

Catalog footprint

What is connected

19works
7topics
4close collaborators

Actions

Connect this record

Log in to claim

Research graph

See the researcher in context

Open full explorer

Inspect adjacent papers, topics, institutions and collaborators without losing the researcher page.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Published work

19 published item(s)

preprint2023arXiv

Metric Embedding via Shortest Path Decompositions

We study the problem of embedding shortest-path metrics of weighted graphs into $\ell_p$ spaces. We introduce a new embedding technique based on low-depth decompositions of a graph via shortest paths. The notion of Shortest Path Decomposition depth is inductively defined: A (weighed) path graph has shortest path decomposition (SPD) depth $1$. General graph has an SPD of depth $k$ if it contains a shortest path whose deletion leads to a graph, each of whose components has SPD depth at most $k-1$. In this paper we give an $O(k^{\min\{\frac{1}{p},\frac{1}{2}\}})$-distortion embedding for graphs of SPD depth at most $k$. This result is asymptotically tight for any fixed $p>1$, while for $p=1$ it is tight up to second order terms. As a corollary of this result, we show that graphs having pathwidth $k$ embed into $\ell_p$ with distortion $O(k^{\min\{\frac{1}{p},\frac{1}{2}\}})$. For $p=1$, this improves over the best previous bound of Lee and Sidiropoulos that was exponential in $k$; moreover, for other values of $p$ it gives the first embeddings whose distortion is independent of the graph size $n$. Furthermore, we use the fact that planar graphs have SPD depth $O(\log n)$ to give a new proof that any planar graph embeds into $\ell_1$ with distortion $O(\sqrt{\log n})$. Our approach also gives new results for graphs with bounded treewidth, and for graphs excluding a fixed minor.

preprint2022arXiv

Almost Shortest Paths with Near-Additive Error in Weighted Graphs

Let $G=(V,E,w)$ be a weighted undirected graph with $n$ vertices and $m$ edges, and fix a set of $s$ sources $S\subseteq V$. We study the problem of computing {\em almost shortest paths} (ASP) for all pairs in $S \times V$ in both classical centralized and parallel (PRAM) models of computation. Consider the regime of multiplicative approximation of $1+ε$, for an arbitrarily small constant $ε> 0$ . In this regime existing centralized algorithms require $Ω(\min\{|E|s,n^ω\})$ time, where $ω< 2.372$ is the matrix multiplication exponent. Existing PRAM algorithms with polylogarithmic depth (aka time) require work $Ω(\min\{|E|s,n^ω\})$. Our centralized algorithm has running time $O((m+ ns)n^ρ)$, and its PRAM counterpart has polylogarithmic depth and work $O((m + ns)n^ρ)$, for an arbitrarily small constant $ρ> 0$. For a pair $(s,v) \in S\times V$, it provides a path of length $\hat{d}(s,v)$ that satisfies $\hat{d}(s,v) \le (1+ε)d_G(s,v) + β\cdot W(s,v)$, where $W(s,v)$ is the weight of the heaviest edge on some shortest $s-v$ path. Hence our additive term depends linearly on a {\em local} maximum edge weight, as opposed to the global maximum edge weight in previous works. Finally, our $β= (1/ρ)^{O(1/ρ)}$. We also extend a centralized algorithm of Dor et al. \cite{DHZ00}. For a parameter $κ= 1,2,\ldots$, this algorithm provides for {\em unweighted} graphs a purely additive approximation of $2(κ-1)$ for {\em all pairs shortest paths} (APASP) in time $\tilde{O}(n^{2+1/κ})$. Within the same running time, our algorithm for {\em weighted} graphs provides a purely additive error of $2(κ- 1) W(u,v)$, for every vertex pair $(u,v) \in {V \choose 2}$, with $W(u,v)$ defined as above. On the way to these results we devise a suit of novel constructions of spanners, emulators and hopsets.

preprint2021arXiv

Centralized, Parallel, and Distributed Multi-Source Shortest Paths via Hopsets and Rectangular Matrix Multiplication

Consider an undirected weighted graph $G = (V,E,w)$. We study the problem of computing $(1+ε)$-approximate shortest paths for $S \times V$, for a subset $S \subseteq V$ of $|S| = n^r$ sources, for some $0 < r \le 1$. We devise a significantly improved algorithm for this problem in the entire range of parameter $r$, in both the classical centralized and the parallel (PRAM) models of computation, and in a wide range of $r$ in the distributed (Congested Clique) model. Specifically, our centralized algorithm for this problem requires time $\tilde{O}(|E| \cdot n^{o(1)} + n^{ω(r)})$, where $n^{ω(r)}$ is the time required to multiply an $n^r \times n$ matrix by an $n \times n$ one. Our PRAM algorithm has polylogarithmic time $(\log n)^{O(1/ρ)}$, and its work complexity is $\tilde{O}(|E| \cdot n^ρ+ n^{ω(r)})$, for any arbitrarily small constant $ρ>0$. In particular, for $r \le 0.313\ldots$, our centralized algorithm computes $S \times V$ $(1+ε)$-approximate shortest paths in $n^{2 + o(1)}$ time. Our PRAM polylogarithmic-time algorithm has work complexity $O(|E| \cdot n^ρ+ n^{2+o(1)})$, for any arbitrarily small constant $ρ>0$. Previously existing solutions either require centralized time/parallel work of $O(|E| \cdot |S|)$ or provide much weaker approximation guarantees. In the Congested Clique model, our algorithm solves the problem in polylogarithmic time for $|S| = n^r$ sources, for $r \le 0.655$, while previous state-of-the-art algorithms did so only for $r \le 1/2$. Moreover, it improves previous bounds for all $r > 1/2$. For unweighted graphs, the running time is improved further to $poly(\log\log n)$.

preprint2021arXiv

Cops, Robbers, and Threatening Skeletons: Padded Decomposition for Minor-Free Graphs

We prove that any graph excluding $K_r$ as a minor has can be partitioned into clusters of diameter at most $Δ$ while removing at most $O(r/Δ)$ fraction of the edges. This improves over the results of Fakcharoenphol and Talwar, who building on the work of Klein, Plotkin and Rao gave a partitioning that required to remove $O(r^2/Δ)$ fraction of the edges. Our result is obtained by a new approach to relate the topological properties (excluding a minor) of a graph to its geometric properties (the induced shortest path metric). Specifically, we show that techniques used by Andreae in his investigation of the cops-and-robbers game on excluded-minor graphs can be used to construct padded decompositions of the metrics induced by such graphs. In particular, we get probabilistic partitions with padding parameter $O(r)$ and strong-diameter partitions with padding parameter $O(r^2)$ for $K_r$-free graphs, padding $O(k)$ for graphs with treewidth $k$, and padding $O(\log g)$ for graphs with genus $g$.

preprint2021arXiv

Improved Weighted Additive Spanners

Graph spanners and emulators are sparse structures that approximately preserve distances of the original graph. While there has been an extensive amount of work on additive spanners, so far little attention was given to weighted graphs. Only very recently [ABSKS20] extended the classical +2 (respectively, +4) spanners for unweighted graphs of size $O(n^{3/2})$ (resp., $O(n^{7/5})$) to the weighted setting, where the additive error is $+2W$ (resp., $+4W$). This means that for every pair $u,v$, the additive stretch is at most $+2W_{u,v}$, where $W_{u,v}$ is the maximal edge weight on the shortest $u-v$ path. In addition, [ABSKS20] showed an algorithm yielding a $+8W_{max}$ spanner of size $O(n^{4/3})$, here $W_{max}$ is the maximum edge weight in the entire graph. In this work we improve the latter result by devising a simple deterministic algorithm for a $+(6+\varepsilon)W$ spanner for weighted graphs with size $O(n^{4/3})$ (for any constant $\varepsilon>0$), thus nearly matching the classical +6 spanner of size $O(n^{4/3})$ for unweighted graphs. Furthermore, we show a $+(2+\varepsilon)W$ subsetwise spanner of size $O(n\cdot\sqrt{|S|})$, improving the $+4W_{max}$ result of [ABSKS20] (that had the same size). We also show a simple randomized algorithm for a $+4W$ emulator of size $\tilde{O}(n^{4/3})$. In addition, we show that our technique is applicable for very sparse additive spanners, that have linear size. For weighted graphs, we use a variant of our simple deterministic algorithm that yields a linear size $+\tilde{O}(\sqrt{n}\cdot W)$ spanner, and we also obtain a tradeoff between size and stretch. Finally, generalizing the technique of [DHZ00] for unweighted graphs, we devise an efficient randomized algorithm producing a $+2W$ spanner for weighted graphs of size $\tilde{O}(n^{3/2})$ in $\tilde{O}(n^2)$ time.

preprint2020arXiv

Near-Additive Spanners and Near-Exact Hopsets, A Unified View

Given an {\em unweighted} undirected graph $G = (V,E)$, and a pair of parameters $ε> 0$, $β= 1,2,\ldots$, a subgraph $G' =(V,H)$, $H \subseteq E$, of $G$ is a {\em $(1+ε,β)$-spanner} (aka, a {\em near-additive spanner}) of $G$ if for every $u,v \in V$, $$d_{G'}(u,v) \le (1+ε)d_G(u,v) + β~.$$ It was shown in \cite{EP01} that for any $n$-vertex $G$ as above, and any $ε> 0$ and $κ= 1,2,\ldots$, there exists a $(1+ε,β)$-spanner $G'$ with $O_{ε,κ}(n^{1+1/κ})$ edges, with $$β= β_{EP} = \left({{\log κ} \over ε}\right)^{\log κ- 2}~.$$ This bound remains state-of-the-art, and its dependence on $ε$ (for the case of small $κ$) was shown to be tight in \cite{ABP18}. Given a {\em weighted} undirected graph $G = (V,E,ω)$, and a pair of parameters $ε> 0$, $β= 1,2,\ldots$, a graph $G'= (V,H,ω')$ is a {\em $(1+ε,β)$-hopset} (aka, a {\em near-exact hopset}) of $G$ if for every $u,v \in V$, $$d_G(u,v) \le d_{G\cup G'}^{(β)}(u,v) \le (1+ε)d_G(u,v)~,$$ where $ d_{G\cup G'}^{(β)}(u,v)$ stands for a $β$-(hop)-bounded distance between $u$ and $v$ in the union graph $G \cup G'$. It was shown in \cite{EN16} that for any $n$-vertex $G$ and $ε$ and $κ$ as above, there exists a $(1+ε,β)$-hopset with $\tilde{O}(n^{1+1/κ})$ edges, with $β= β_{EP}$. Not only the two results of \cite{EP01} and \cite{EN16} are strikingly similar, but so are also their proof techniques. Moreover, Thorup-Zwick's later construction of near-additive spanners \cite{TZ06} was also shown in \cite{EN19,HP17} to provide hopsets with analogous (to that of \cite{TZ06}) properties. In this survey we explore this intriguing phenomenon, sketch the basic proof techniques used for these results, and highlight open questions.

preprint2016arXiv

Distributed Strong Diameter Network Decomposition

For a pair of positive parameters $D,χ$, a partition ${\cal P}$ of the vertex set $V$ of an $n$-vertex graph $G = (V,E)$ into disjoint clusters of diameter at most $D$ each is called a $(D,χ)$ network decomposition, if the supergraph ${\cal G}({\cal P})$, obtained by contracting each of the clusters of ${\cal P}$, can be properly $χ$-colored. The decomposition ${\cal P}$ is said to be strong (resp., weak) if each of the clusters has strong (resp., weak) diameter at most $D$, i.e., if for every cluster $C \in {\cal P}$ and every two vertices $u,v \in C$, the distance between them in the induced graph $G(C)$ of $C$ (resp., in $G$) is at most $D$. Network decomposition is a powerful construct, very useful in distributed computing and beyond. It was shown by Awerbuch \etal \cite{AGLP89} and Panconesi and Srinivasan \cite{PS92}, that strong $(2^{O(\sqrt{\log n})},2^{O(\sqrt{\log n})})$ network decompositions can be computed in $2^{O(\sqrt{\log n})}$ distributed time. Linial and Saks \cite{LS93} devised an ingenious randomized algorithm that constructs {\em weak} $(O(\log n),O(\log n))$ network decompositions in $O(\log^2 n)$ time. It was however open till now if {\em strong} network decompositions with both parameters $2^{o(\sqrt{\log n})}$ can be constructed in distributed $2^{o(\sqrt{\log n})}$ time. In this paper we answer this long-standing open question in the affirmative, and show that strong $(O(\log n),O(\log n))$ network decompositions can be computed in $O(\log^2 n)$ time. We also present a tradeoff between parameters of our network decomposition. Our work is inspired by and relies on the "shifted shortest path approach", due to Blelloch \etal \cite{BGKMPT11}, and Miller \etal \cite{MPX13}. These authors developed this approach for PRAM algorithms for padded partitions. We adapt their approach to network decompositions in the distributed model of computation.

preprint2016arXiv

Hopsets with Constant Hopbound, and Applications to Approximate Shortest Paths

A $(β,ε)$-hopset for a weighted undirected $n$-vertex graph $G=(V,E)$ is a set of edges, whose addition to the graph guarantees that every pair of vertices has a path between them that contains at most $β$ edges, whose length is within $1+ε$ of the shortest path. In her seminal paper, Cohen \cite[JACM 2000]{C00} introduced the notion of hopsets in the context of parallel computation of approximate shortest paths, and since then it has found numerous applications in various other settings, such as dynamic graph algorithms, distributed computing, and the streaming model. Cohen \cite{C00} devised efficient algorithms for constructing hopsets with {\em polylogarithmic} in $n$ number of hops. Her constructions remain the state-of-the--art since the publication of her paper in STOC'94, i.e., for more than two decades. In this paper we exhibit the first construction of sparse hopsets with a {\em constant number of hops}. We also find efficient algorithms for hopsets in various computational settings, improving the best known constructions. Generally, our hopsets strictly outperform the hopsets of \cite{C00}, both in terms of their parameters, and in terms of the resources required to construct them. We demonstrate the applicability of our results for the fundamental problem of computing approximate shortest paths from $s$ sources. Our results improve the running time for this problem in the parallel, distributed and streaming models, for a vast range of $s$.

preprint2016arXiv

On Efficient Distributed Construction of Near Optimal Routing Schemes

Given a distributed network represented by a weighted undirected graph $G=(V,E)$ on $n$ vertices, and a parameter $k$, we devise a distributed algorithm that computes a routing scheme in $(n^{1/2+1/k}+D)\cdot n^{o(1)}$ rounds, where $D$ is the hop-diameter of the network. The running time matches the lower bound of $\tildeΩ(n^{1/2}+D)$ rounds (which holds for any scheme with polynomial stretch), up to lower order terms. The routing tables are of size $\tilde{O}(n^{1/k})$, the labels are of size $O(k\log^2n)$, and every packet is routed on a path suffering stretch at most $4k-5+o(1)$. Our construction nearly matches the state-of-the-art for routing schemes built in a centralized sequential manner. The previous best algorithms for building routing tables in a distributed small messages model were by \cite[STOC 2013]{LP13} and \cite[PODC 2015]{LP15}. The former has similar properties but suffers from substantially larger routing tables of size $O(n^{1/2+1/k})$, while the latter has sub-optimal running time of $\tilde{O}(\min\{(nD)^{1/2}\cdot n^{1/k},n^{2/3+2/(3k)}+D\})$.

preprint2016arXiv

On Vertex Rankings of Graphs and its Relatives

A vertex ranking of a graph is an assignment of ranks (or colors) to the vertices of the graph, in such a way that any simple path connecting two vertices of equal rank, must contain a vertex of a higher rank. In this paper we study a relaxation of this notion, in which the requirement above should only hold for paths of some bounded length $l$ for some fixed $l$. For instance, already the case $l=2$ exhibit quite a different behavior than proper coloring. We prove upper and lower bounds on the minimum number of ranks required for several graph families, such as trees, planar graphs, graphs excluding a fixed minor and degenerate graphs.

preprint2016arXiv

Terminal Embeddings

In this paper we study {\em terminal embeddings}, in which one is given a finite metric $(X,d_X)$ (or a graph $G=(V,E)$) and a subset $K \subseteq X$ of its points are designated as {\em terminals}. The objective is to embed the metric into a normed space, while approximately preserving all distances among pairs that contain a terminal. We devise such embeddings in various settings, and conclude that even though we have to preserve $\approx|K|\cdot |X|$ pairs, the distortion depends only on $|K|$, rather than on $|X|$. We also strengthen this notion, and consider embeddings that approximately preserve the distances between {\em all} pairs, but provide improved distortion for pairs containing a terminal. Surprisingly, we show that such embeddings exist in many settings, and have optimal distortion bounds both with respect to $X \times X$ and with respect to $K \times X$. Moreover, our embeddings have implications to the areas of Approximation and Online Algorithms. In particular, [ALN08] devised an $\tilde{O}(\sqrt{\log r})$-approximation algorithm for sparsest-cut instances with $r$ demands. Building on their framework, we provide an $\tilde{O}(\sqrt{\log |K|})$-approximation for sparsest-cut instances in which each demand is incident on one of the vertices of $K$ (aka, terminals). Since $|K| \le r$, our bound generalizes that of [ALN08].

preprint2015arXiv

Prioritized Metric Structures and Embedding

Metric data structures (distance oracles, distance labeling schemes, routing schemes) and low-distortion embeddings provide a powerful algorithmic methodology, which has been successfully applied for approximation algorithms \cite{llr}, online algorithms \cite{BBMN11}, distributed algorithms \cite{KKMPT12} and for computing sparsifiers \cite{ST04}. However, this methodology appears to have a limitation: the worst-case performance inherently depends on the cardinality of the metric, and one could not specify in advance which vertices/points should enjoy a better service (i.e., stretch/distortion, label size/dimension) than that given by the worst-case guarantee. In this paper we alleviate this limitation by devising a suit of {\em prioritized} metric data structures and embeddings. We show that given a priority ranking $(x_1,x_2,\ldots,x_n)$ of the graph vertices (respectively, metric points) one can devise a metric data structure (respectively, embedding) in which the stretch (resp., distortion) incurred by any pair containing a vertex $x_j$ will depend on the rank $j$ of the vertex. We also show that other important parameters, such as the label size and (in some sense) the dimension, may depend only on $j$. In some of our metric data structures (resp., embeddings) we achieve both prioritized stretch (resp., distortion) and label size (resp., dimension) {\em simultaneously}. The worst-case performance of our metric data structures and embeddings is typically asymptotically no worse than of their non-prioritized counterparts.

preprint2015arXiv

Snowflake universality of Wasserstein spaces

For $p\in (1,\infty)$ let $\mathscr{P}_p(\mathbb{R}^3)$ denote the metric space of all $p$-integrable Borel probability measures on $\mathbb{R}^3$, equipped with the Wasserstein $p$ metric $\mathsf{W}_p$. We prove that for every $\varepsilon>0$, every $θ\in (0,1/p]$ and every finite metric space $(X,d_X)$, the metric space $(X,d_{X}^θ)$ embeds into $\mathscr{P}_p(\mathbb{R}^3)$ with distortion at most $1+\varepsilon$. We show that this is sharp when $p\in (1,2]$ in the sense that the exponent $1/p$ cannot be replaced by any larger number. In fact, for arbitrarily large $n\in \mathbb{N}$ there exists an $n$-point metric space $(X_n,d_n)$ such that for every $α\in (1/p,1]$ any embedding of the metric space $(X_n,d_n^α)$ into $\mathscr{P}_p(\mathbb{R}^3)$ incurs distortion that is at least a constant multiple of $(\log n)^{α-1/p}$. These statements establish that there exists an Alexandrov space of nonnegative curvature, namely $\mathscr{P}_{\! 2}(\mathbb{R}^3)$, with respect to which there does not exist a sequence of bounded degree expander graphs. It also follows that $\mathscr{P}_{\! 2}(\mathbb{R}^3)$ does not admit a uniform, coarse, or quasisymmetric embedding into any Banach space of nontrivial type. Links to several longstanding open questions in metric geometry are discussed, including the characterization of subsets of Alexandrov spaces, existence of expanders, the universality problem for $\mathscr{P}_{\! 2}(\mathbb{R}^k)$, and the metric cotype dichotomy problem.

preprint2014arXiv

Light Spanners

A $t$-spanner of a weighted undirected graph $G=(V,E)$, is a subgraph $H$ such that $d_H(u,v)\le t\cdot d_G(u,v)$ for all $u,v\in V$. The sparseness of the spanner can be measured by its size (the number of edges) and weight (the sum of all edge weights), both being important measures of the spanner's quality -- in this work we focus on the latter. Specifically, it is shown that for any parameters $k\ge 1$ and $ε>0$, any weighted graph $G$ on $n$ vertices admits a $(2k-1)\cdot(1+ε)$-stretch spanner of weight at most $w(MST(G))\cdot O_ε(kn^{1/k}/\log k)$, where $w(MST(G))$ is the weight of a minimum spanning tree of $G$. Our result is obtained via a novel analysis of the classic greedy algorithm, and improves previous work by a factor of $O(\log k)$.

preprint2014arXiv

Space-Efficient Path-Reporting Approximate Distance Oracles

We consider approximate {\em path-reporting} distance oracles, distance labeling and labeled routing with extremely low space requirement, for general undirected graphs. For distance oracles, we show how to break the n\log n space bound of Thorup and Zwick if approximate {\em paths} rather than distances need to be reported. For approximate distance labeling and labeled routing, we break the previously best known space bound of O(log n) words per vertex. The cost for such space efficiency is an increased stretch.

preprint2013arXiv

On the Impossibility of Dimension Reduction for Doubling Subsets of $\ell_p$, $p>2$

A major open problem in the field of metric embedding is the existence of dimension reduction for $n$-point subsets of Euclidean space, such that both distortion and dimension depend only on the {\em doubling constant} of the pointset, and not on its cardinality. In this paper, we negate this possibility for $\ell_p$ spaces with $p>2$. In particular, we introduce an $n$-point subset of $\ell_p$ with doubling constant O(1), and demonstrate that any embedding of the set into $\ell_p^d$ with distortion $D$ must have $D\geΩ\left(\left(\frac{c\log n}{d}\right)^{\frac{1}{2}-\frac{1}{p}}\right)$.

preprint2013arXiv

Simple Deterministic Algorithms for Fully Dynamic Maximal Matching

A maximal matching can be maintained in fully dynamic (supporting both addition and deletion of edges) $n$-vertex graphs using a trivial deterministic algorithm with a worst-case update time of O(n). No deterministic algorithm that outperforms the na\"ıve O(n) one was reported up to this date. The only progress in this direction is due to Ivković and Lloyd \cite{IL93}, who in 1993 devised a deterministic algorithm with an \emph{amortized} update time of $O((n+m)^{\sqrt{2}/2})$, where $m$ is the number of edges. In this paper we show the first deterministic fully dynamic algorithm that outperforms the trivial one. Specifically, we provide a deterministic \emph{worst-case} update time of $O(\sqrt{m})$. Moreover, our algorithm maintains a matching which is in fact a 3/2-approximate maximum cardinality matching (MCM). We remark that no fully dynamic algorithm for maintaining $(2-\eps)$-approximate MCM improving upon the na\"ıve O(n) was known prior to this work, even allowing amortized time bounds and \emph{randomization}. For low arboricity graphs (e.g., planar graphs and graphs excluding fixed minors), we devise another simple deterministic algorithm with \emph{sub-logarithmic update time}. Specifically, it maintains a fully dynamic maximal matching with amortized update time of $O(\log n/\log \log n)$. This result addresses an open question of Onak and Rubinfeld \cite{OR10}. We also show a deterministic algorithm with optimal space usage, that for arbitrary graphs maintains a maximal matching in amortized $O(\sqrt{m})$ time, and uses only $O(n+m)$ space.

preprint2010arXiv

Assouad's theorem with dimension independent of the snowflaking

It is shown that for every $K>0$ and $\e\in (0,1/2)$ there exist $N=N(K)\in \N$ and $D=D(K,\e)\in (1,\infty)$ with the following properties. For every separable metric space $(X,d)$ with doubling constant at most $K$, the metric space $(X,d^{1-\e})$ admits a bi-Lipschitz embedding into $\R^N$ with distortion at most $D$. The classical Assouad embedding theorem makes the same assertion, but with $N\to \infty$ as $\e\to 0$.

preprint2006arXiv

Embedding Metrics into Ultrametrics and Graphs into Spanning Trees with Constant Average Distortion

This paper addresses the basic question of how well can a tree approximate distances of a metric space or a graph. Given a graph, the problem of constructing a spanning tree in a graph which strongly preserves distances in the graph is a fundamental problem in network design. We present scaling distortion embeddings where the distortion scales as a function of $ε$, with the guarantee that for each $ε$ the distortion of a fraction $1-ε$ of all pairs is bounded accordingly. Such a bound implies, in particular, that the \emph{average distortion} and $\ell_q$-distortions are small. Specifically, our embeddings have \emph{constant} average distortion and $O(\sqrt{\log n})$ $\ell_2$-distortion. This follows from the following results: we prove that any metric space embeds into an ultrametric with scaling distortion $O(\sqrt{1/ε})$. For the graph setting we prove that any weighted graph contains a spanning tree with scaling distortion $O(\sqrt{1/ε})$. These bounds are tight even for embedding in arbitrary trees. For probabilistic embedding into spanning trees we prove a scaling distortion of $\tilde{O}(\log^2 (1/ε))$, which implies \emph{constant} $\ell_q$-distortion for every fixed $q<\infty$.