cost Cygan et al. [2018], Cohen-Addad et al. [2019]. When the facilities can have arbitrary non-
uniform costs in a general metric space, prior to our work the best known fully dynamic algorithm
achieved a O(log |F|)approximation with polylogarithmic recourse Guo et al. [2020].
2 Our Dynamic Algorithm
In Section 2.1, we present an intuitive overview of our algorithm. We formally describe our algorithm
in Section 2.2 and Section 2.3, and analyze its recourse and approximation guarantee in Section 2.4.
2.1 An Informal Overview of Our Algorithm
We start by recalling a natural greedy algorithm for the facility location problem in the static setting.
This (static) algorithm is known to return a constant approximation for the problem Jain et al. [2003].
The algorithm proceeds in rounds. Throughout the duration of the algorithm, let
F∗⊆F
and
D∗⊆D
respectively denoted the set of opened facilities and the set of clients that are already
assigned to some open facility. Initially, before the start of the first round, we set
F∗← ∅
and
D∗← ∅. The next paragraph describes what happens during a given round of this algorithm.
Say that a cluster
C
is an ordered pair
(i, A)
, where
i∈F
and
A⊆D
. A cluster is either
satellite or critical. If a cluster
C= (i, A)
is satellite (resp. critical), then its cost is given by
cost(C) := Pj∈Adij
(resp.
cost(C) := fi+Pj∈Adij
). Thus, the only difference between an
satellite cluster and a critical cluster is that the cost of the former (resp. latter) does not (resp. does)
include the opening cost of the concerned facility. The average cost of a cluster
C= (i, A)
is defined
as
costavg(C) := cost(C)/|A|
. Let
Cord(F∗, D∗)
be the set of all satellite clusters
C= (i, A)
with
i∈F∗
and
A⊆D\D∗
, and let
Ccrit(F∗, D∗)
be the set of all critical clusters
C= (i, A)
with
i∈F\F∗
and
A⊆D\D∗
. In the current round, we pick a cluster
C= (i, A)∈
Ccrit(F∗, D∗)∪ Cord(F∗, D∗)
with minimum average cost, set
F∗←F∗∪ {i}
and
D∗←D∗∪A
,
and assign all the clients
j∈A
to the facility
i
. At this point, if
D∗=D
, then we terminate the
algorithm. Otherwise, we proceed to the next round.
Intuitively, in each round the above greedy algorithm picks a cluster with minimum average cost,
which is defined in such a way that takes into account the opening cost of a facility the first time some
client gets assigned to it. Let
C
denote the collection of all clusters picked by this algorithm, across all
the rounds. Note: (1) Every client
j∈A
belongs to exactly one cluster in
C
. (2) Let
C(i)⊆ C
denote
the subset of clusters in
C
which contain a given facility
i∈F
. If
C(i)6=∅
, then exactly one of the
clusters in
C(i)
is critical. We refer to a collection
C
which satisfy these two properties as a clustering.
It is easy to check that a clustering
C
defines a valid solution to the concerned instance of the facility
location problem, where the objective value of the solution is given by obj(C) := PC∈C cost(C).
Note that if the above algorithm picks an satellite cluster
C= (i, A)
in a given round, then w.l.o.g. we
can assume that
|A|= 1
. This is because if
|A|>1
, then we can only decrease the average cost of
C
by deleting from
A
all but the one client that is closest to facility
i
. Accordingly, from now on we
will only consider those satellite clusters that have exactly one client.
Our dynamic algorithm is based on a relaxation of the above static greedy algorithm, where in each
round we have the flexibility of picking a cluster with approximately minimum average cost. The
output of this relaxed greedy algorithm corresponds to what we call a nice clustering (see Section 2.2
for a formal definition). We now present a high-level, informal overview of our dynamic algorithm.
Preprocessing:
Upon receiving an input
(F, D)
at preprocessing, we run the relaxed greedy algorithm
which returns a nice clustering
C
. We assign each cluster
C∈ C
to an (not necessarily positive) integer
level
`(C)∈Z
such that
costavg(C) = Θ(2`(C))
. Thus, the level of a cluster encodes its average
cost upto a constant multiplicative factor. Define the level of a client j∈Cto be `(j) := `(C).
Handling an update:
When a client
j
gets deleted from
D
, we simply delete the concerned client
from the cluster in
C
it appears in. Similarly, when a client
j
gets inserted into
D
, we arbitrarily
assign it to any open facility
i
by creating an satellite cluster
(C= (i, {j})
at the minimum possible
level
k≥Θ(log dij )
. At this point, we check if the clustering
C
being maintained by our algorithm
still remains nice, i.e., whether
C
can correspond to an output of the relaxed greedy algorithm on the
current input. If the answer is yes, then our dynamic algorithm is done with handling the current
update. Thus, for the rest of this discussion, assume that the clustering Cis no longer nice.
3