Source author record

Stefano Leucci

Stefano Leucci 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

17works
6topics
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

17 published item(s)

preprint2026arXiv

Complexity Thresholds for the Constrained Colored Token Swapping Problem

Consider the following puzzle: a farmland consists of several fields, each occupied by either a farmer, a fox, a chicken, or a caterpillar. Creatures in neighboring fields can swap positions as long as the fox avoids the farmer, the chicken avoids the fox, and the caterpillar avoids the chicken. The objective is to decide whether there exists a sequence of swaps that rearranges the creatures into a desired final configuration, while avoiding any unwanted encounters. The above puzzle can be cast an instance of the \emph{colored token swapping} problem with $k = 4$ colors (i.e., creature types), in which only certain pairs of colors can be swapped. We prove that such problem is $\mathsf{PSPACE}$-hard even when the graph representing the farmland is planar and cubic. We also show that the problem is polynomial-time solvable when at most three creature types are involved. We do so by providing a more general algorithm deciding instances with arbitrary values of $k$, as long as the set of all admissible swaps between creature types induces a \emph{spanning star}. Our results settle a problem explicitly left open in [Yang and Zhang, IPL 2025], which established $\mathsf{PSPACE}$-completeness for eight creature types and left the complexity status unresolved when the number of creature types is between three and seven.

preprint2022arXiv

Sparse Temporal Spanners with Low Stretch

A temporal graph is an undirected graph $G=(V,E)$ along with a function that assigns a time-label to each edge in $E$. A path in $G$ with non-decreasing time-labels is called temporal path and the distance from $u$ to $v$ is the minimum length (i.e., the number of edges) of a temporal path from $u$ to $v$. A temporal $α$-spanner of $G$ is a (temporal) subgraph $H$ that preserves the distances between any pair of vertices in $V$, up to a multiplicative stretch factor of $α$. The size of $H$ is the number of its edges. In this work we study the size-stretch trade-offs of temporal spanners. We show that temporal cliques always admit a temporal $(2k-1)-$spanner with $\tilde{O}(kn^{1+\frac{1}{k}})$ edges, where $k>1$ is an integer parameter of choice. Choosing $k=\lfloor\log n\rfloor$, we obtain a temporal $O(\log n)$-spanner with $\tilde{O}(n)$ edges that has almost the same size (up to logarithmic factors) as the temporal spanner in [Casteigts et al., JCSS 2021] which only preserves temporal connectivity. We then consider general temporal graphs. Since $Ω(n^2)$ edges might be needed by any connectivity-preserving temporal subgraph [Axiotis et al., ICALP'16], we focus on approximating distances from a single source. We show that $\tilde{O}(n/\log(1+\varepsilon))$ edges suffice to obtain a stretch of $(1+\varepsilon)$, for any small $\varepsilon>0$. This result is essentially tight since there are temporal graphs for which any temporal subgraph preserving exact distances from a single-source must use $Ω(n^2)$ edges. We extend our analysis to prove an upper bound of $\tilde{O}(n^2/β)$ on the size of any temporal $β$-additive spanner, which is tight up to polylogarithmic factors. Finally, we investigate how the lifetime of $G$, i.e., the number of its distinct time-labels, affects the trade-off between the size and the stretch of a temporal spanner.

preprint2020arXiv

Approximate Minimum Selection with Unreliable Comparisons in Optimal Expected Time

We consider the \emph{approximate minimum selection} problem in presence of \emph{independent random comparison faults}. This problem asks to select one of the smallest $k$ elements in a linearly-ordered collection of $n$ elements by only performing \emph{unreliable} pairwise comparisons: whenever two elements are compared, there is a constant probability that the wrong answer is returned. We design a randomized algorithm that solves this problem with probability $1-q \in [ \frac{1}{2}, 1)$ and for the whole range of values of $k$ using $O( \frac{n}{k} \log \frac{1}{q} )$ expected time. Then, we prove that the expected running time of any algorithm that succeeds w.h.p. must be $Ω(\frac{n}{k}\log \frac{1}{q})$, thus implying that our algorithm is asymptotically optimal, in expectation. These results are quite surprising in the sense that for $k$ between $Ω(\log \frac{1}{q})$ and $c \cdot n$, for any constant $c<1$, the expected running time must still be $Ω(\frac{n}{k}\log \frac{1}{q})$ even in absence of comparison faults. Informally speaking, we show how to deal with comparison errors without any substantial complexity penalty w.r.t.\ the fault-free case. Moreover, we prove that as soon as $k = O( \frac{n}{\log\log \frac{1}{q}})$, it is possible to achieve the optimal \emph{worst-case} running time of $Θ(\frac{n}{k}\log \frac{1}{q})$.

preprint2020arXiv

Cutting Bamboo Down to Size

This paper studies the problem of programming a robotic panda gardener to keep a bamboo garden from obstructing the view of the lake by your house. The garden consists of $n$ bamboo stalks with known daily growth rates and the gardener can cut at most one bamboo per day. As a computer scientist, you found out that this problem has already been formalized in [Gąsieniec et al., SOFSEM'17] as the Bamboo Garden Trimming (BGT) problem, where the goal is that of computing a perpetual schedule (i.e., the sequence of bamboos to cut) for the robotic gardener to follow in order to minimize the makespan, i.e., the maximum height ever reached by a bamboo. Two natural strategies are Reduce-Max and Reduce-Fastest(x). Reduce-Max trims the tallest bamboo of the day, while Reduce-Fastest(x) trims the fastest growing bamboo among the ones that are taller than $x$. It is known that Reduce-Max and Reduce-Fastest(x) achieve a makespan of $O(\log n)$ and $4$ for the best choice of $x=2$, respectively. We prove the first constant upper bound of $9$ for Reduce-Max and improve the one for Reduce-Fastest(x) to $\frac{3+\sqrt{5}}{2} < 2.62$ for $x=1+\frac{1}{\sqrt{5}}$. Another critical aspect stems from the fact that your robotic gardener has a limited amount of processing power and memory. It is then important for the algorithm to be able to quickly determine the next bamboo to cut while requiring at most linear space. We formalize this aspect as the problem of designing a Trimming Oracle data structure, and we provide three efficient Trimming Oracles implementing different perpetual schedules, including those produced by Reduce-Max and Reduce-Fastest(x).

preprint2016arXiv

Compact and Fast Sensitivity Oracles for Single-Source Distances

Let $s$ denote a distinguished source vertex of a non-negatively real weighted and undirected graph $G$ with $n$ vertices and $m$ edges. In this paper we present two efficient \emph{single-source approximate-distance sensitivity oracles}, namely \emph{compact} data structures which are able to \emph{quickly} report an approximate (by a multiplicative stretch factor) distance from $s$ to any node of $G$ following the failure of any edge in $G$. More precisely, we first present a sensitivity oracle of size $O(n)$ which is able to report 2-approximate distances from the source in $O(1)$ time. Then, we further develop our construction by building, for any $0<ε<1$, another sensitivity oracle having size $O\left(n\cdot \frac{1}ε \log \frac{1}ε\right)$, and which is able to report a $(1+ε)$-approximate distance from $s$ to any vertex of $G$ in $O\left(\log n\cdot \frac{1}ε \log \frac{1}ε\right)$ time. Thus, this latter oracle is essentially optimal as far as size and stretch are concerned, and it only asks for a logarithmic query time. Finally, our results are complemented with a space lower bound for the related class of single-source \emph{additively-stretched} sensitivity oracles, which is helpful to realize the hardness of designing compact oracles of this type.

preprint2016arXiv

Fault-Tolerant Approximate Shortest-Path Trees

The resiliency of a network is its ability to remain \emph{effectively} functioning also when any of its nodes or links fails. However, to reduce operational and set-up costs, a network should be small in size, and this conflicts with the requirement of being resilient. In this paper we address this trade-off for the prominent case of the {\em broadcasting} routing scheme, and we build efficient (i.e., sparse and fast) \emph{fault-tolerant approximate shortest-path trees}, for both the edge and vertex \emph{single-failure} case. In particular, for an $n$-vertex non-negatively weighted graph, and for any constant $\varepsilon >0$, we design two structures of size $O(\frac{n \log n}{\varepsilon^2})$ which guarantee $(1+\varepsilon)$-stretched paths from the selected source also in the presence of an edge/vertex failure. This favorably compares with the currently best known solutions, which are for the edge-failure case of size $O(n)$ and stretch factor 3, and for the vertex-failure case of size $O(n \log n)$ and stretch factor 3. Moreover, we also focus on the unweighted case, and we prove that an ordinary $(α,β)$-spanner can be slightly augmented in order to build efficient fault-tolerant approximate \emph{breadth-first-search trees}.

preprint2016arXiv

Large Peg-Army Maneuvers

Despite its long history, the classical game of peg solitaire continues to attract the attention of the scientific community. In this paper, we consider two problems with an algorithmic flavour which are related with this game, namely Solitaire-Reachability and Solitaire-Army. In the first one, we show that deciding whether there is a sequence of jumps which allows a given initial configuration of pegs to reach a target position is NP-complete. Regarding Solitaire-Army, the aim is to successfully deploy an army of pegs in a given region of the board in order to reach a target position. By solving an auxiliary problem with relaxed constraints, we are able to answer some open questions raised by Csákány and Juhász (Mathematics Magazine, 2000). To appreciate the combinatorial beauty of our solutions, we recommend to visit the gallery of animations provided at http://solitairearmy.isnphard.com.

preprint2016arXiv

Locality-based Network Creation Games

Network creation games have been extensively studied, both from economists and computer scientists, due to their versatility in modeling individual-based community formation processes, which in turn are the theoretical counterpart of several economics, social, and computational applications on the Internet. In their several variants, these games model the tension of a player between her two antagonistic goals: to be as close as possible to the other players, and to activate a cheapest possible set of links. However, the generally adopted assumption is that players have a \emph{common and complete} information about the ongoing network, which is quite unrealistic in practice. In this paper, we consider a more compelling scenario in which players have only limited information about the network they are embedded in. More precisely, we explore the game-theoretic and computational implications of assuming that players have a complete knowledge of the network structure only up to a given radius $k$, which is one of the most qualified \emph{local-knowledge models} used in distributed computing. To this respect, we define a suitable equilibrium concept, and we provide a comprehensive set of upper and lower bounds to the price of anarchy for the entire range of values of $k$, and for the two classic variants of the game, namely those in which a player's cost --- besides the activation cost of the owned links --- depends on the maximum/sum of all the distances to the other nodes in the network, respectively. These bounds are finally assessed through an extensive set of experiments.

preprint2016arXiv

Multiple-Edge-Fault-Tolerant Approximate Shortest-Path Trees

Let $G$ be an $n$-node and $m$-edge positively real-weighted undirected graph. For any given integer $f \ge 1$, we study the problem of designing a sparse \emph{f-edge-fault-tolerant} ($f$-EFT) $σ${\em -approximate single-source shortest-path tree} ($σ$-ASPT), namely a subgraph of $G$ having as few edges as possible and which, following the failure of a set $F$ of at most $f$ edges in $G$, contains paths from a fixed source that are stretched at most by a factor of $σ$. To this respect, we provide an algorithm that efficiently computes an $f$-EFT $(2|F|+1)$-ASPT of size $O(f n)$. Our structure improves on a previous related construction designed for \emph{unweighted} graphs, having the same size but guaranteeing a larger stretch factor of $3(f+1)$, plus an additive term of $(f+1) \log n$. Then, we show how to convert our structure into an efficient $f$-EFT \emph{single-source distance oracle} (SSDO), that can be built in $\widetilde{O}(f m)$ time, has size $O(fn \log^2 n)$, and is able to report, after the failure of the edge set $F$, in $O(|F|^2 \log^2 n)$ time a $(2|F|+1)$-approximate distance from the source to any node, and a corresponding approximate path in the same amount of time plus the path's size. Such an oracle is obtained by handling another fundamental problem, namely that of updating a \emph{minimum spanning forest} (MSF) of $G$ after that a \emph{batch} of $k$ simultaneous edge modifications (i.e., edge insertions, deletions and weight changes) is performed. For this problem, we build in $O(m \log^3 n)$ time a \emph{sensitivity} oracle of size $O(m \log^2 n)$, that reports in $O(k^2 \log^2 n)$ time the (at most $2k$) edges either exiting from or entering into the MSF. [...]

preprint2016arXiv

The Limits of Popularity-Based Recommendations, and the Role of Social Ties

In this paper we introduce a mathematical model that captures some of the salient features of recommender systems that are based on popularity and that try to exploit social ties among the users. We show that, under very general conditions, the market always converges to a steady state, for which we are able to give an explicit form. Thanks to this we can tell rather precisely how much a market is altered by a recommendation system, and determine the power of users to influence others. Our theoretical results are complemented by experiments with real world social networks showing that social graphs prevent large market distortions in spite of the presence of highly influential users.

preprint2016arXiv

Trainyard is NP-Hard

Recently, due to the widespread diffusion of smart-phones, mobile puzzle games have experienced a huge increase in their popularity. A successful puzzle has to be both captivating and challenging, and it has been suggested that this features are somehow related to their computational complexity \cite{Eppstein}. Indeed, many puzzle games --such as Mah-Jongg, Sokoban, Candy Crush, and 2048, to name a few-- are known to be NP-hard \cite{CondonFLS97, culberson1999sokoban, GualaLN14, Mehta14a}. In this paper we consider Trainyard: a popular mobile puzzle game whose goal is to get colored trains from their initial stations to suitable destination stations. We prove that the problem of determining whether there exists a solution to a given Trainyard level is NP-hard. We also \href{http://trainyard.isnphard.com}{provide} an implementation of our hardness reduction.

preprint2015arXiv

Improved Purely Additive Fault-Tolerant Spanners

Let $G$ be an unweighted $n$-node undirected graph. A \emph{$β$-additive spanner} of $G$ is a spanning subgraph $H$ of $G$ such that distances in $H$ are stretched at most by an additive term $β$ w.r.t. the corresponding distances in $G$. A natural research goal related with spanners is that of designing \emph{sparse} spanners with \emph{low} stretch. In this paper, we focus on \emph{fault-tolerant} additive spanners, namely additive spanners which are able to preserve their additive stretch even when one edge fails. We are able to improve all known such spanners, in terms of either sparsity or stretch. In particular, we consider the sparsest known spanners with stretch $6$, $28$, and $38$, and reduce the stretch to $4$, $10$, and $14$, respectively (while keeping the same sparsity). Our results are based on two different constructions. On one hand, we show how to augment (by adding a \emph{small} number of edges) a fault-tolerant additive \emph{sourcewise spanner} (that approximately preserves distances only from a given set of source nodes) into one such spanner that preserves all pairwise distances. On the other hand, we show how to augment some known fault-tolerant additive spanners, based on clustering techniques. This way we decrease the additive stretch without any asymptotic increase in their size. We also obtain improved fault-tolerant additive spanners for the case of one vertex failure, and for the case of $f$ edge failures.

preprint2015arXiv

Path-Fault-Tolerant Approximate Shortest-Path Trees

Let $G=(V,E)$ be an $n$-nodes non-negatively real-weighted undirected graph. In this paper we show how to enrich a {\em single-source shortest-path tree} (SPT) of $G$ with a \emph{sparse} set of \emph{auxiliary} edges selected from $E$, in order to create a structure which tolerates effectively a \emph{path failure} in the SPT. This consists of a simultaneous fault of a set $F$ of at most $f$ adjacent edges along a shortest path emanating from the source, and it is recognized as one of the most frequent disruption in an SPT. We show that, for any integer parameter $k \geq 1$, it is possible to provide a very sparse (i.e., of size $O(kn\cdot f^{1+1/k})$) auxiliary structure that carefully approximates (i.e., within a stretch factor of $(2k-1)(2|F|+1)$) the true shortest paths from the source during the lifetime of the failure. Moreover, we show that our construction can be further refined to get a stretch factor of $3$ and a size of $O(n \log n)$ for the special case $f=2$, and that it can be converted into a very efficient \emph{approximate-distance sensitivity oracle}, that allows to quickly (even in optimal time, if $k=1$) reconstruct the shortest paths (w.r.t. our structure) from the source after a path failure, thus permitting to perform promptly the needed rerouting operations. Our structure compares favorably with previous known solutions, as we discuss in the paper, and moreover it is also very effective in practice, as we assess through a large set of experiments.

preprint2014arXiv

Bejeweled, Candy Crush and other Match-Three Games are (NP-)Hard

The twentieth century has seen the rise of a new type of video games targeted at a mass audience of "casual" gamers. Many of these games require the player to swap items in order to form matches of three and are collectively known as \emph{tile-matching match-three games}. Among these, the most influential one is arguably \emph{Bejeweled} in which the matched items (gems) pop and the above gems fall in their place. Bejeweled has been ported to many different platforms and influenced an incredible number of similar games. Very recently one of them, named \emph{Candy Crush Saga} enjoyed a huge popularity and quickly went viral on social networks. We generalize this kind of games by only parameterizing the size of the board, while all the other elements (such as the rules or the number of gems) remain unchanged. Then, we prove that answering many natural questions regarding such games is actually \NP-Hard. These questions include determining if the player can reach a certain score, play for a certain number of turns, and others. We also \href{http://candycrush.isnphard.com}{provide} a playable web-based implementation of our reduction.

preprint2014arXiv

Exact and approximate algorithms for movement problems on (special classes of) graphs

When a large collection of objects (e.g., robots, sensors, etc.) has to be deployed in a given environment, it is often required to plan a coordinated motion of the objects from their initial position to a final configuration enjoying some global property. In such a scenario, the problem of minimizing some function of the distance travelled, and therefore energy consumption, is of vital importance. In this paper we study several motion planning problems that arise when the objects must be moved on a graph, in order to reach certain goals which are of interest for several network applications. Among the others, these goals include broadcasting messages and forming connected or interference-free networks. We study these problems with the aim of minimizing a number of natural measures such as the average/overall distance travelled, the maximum distance travelled, or the number of objects that need to be moved. To this respect, we provide several approximability and inapproximability results, most of which are tight.

preprint2014arXiv

Specializations and Generalizations of the Stackelberg Minimum Spanning Tree Game

Let be given a graph $G=(V,E)$ whose edge set is partitioned into a set $R$ of \emph{red} edges and a set $B$ of \emph{blue} edges, and assume that red edges are weighted and form a spanning tree of $G$. Then, the \emph{Stackelberg Minimum Spanning Tree} (\stack) problem is that of pricing (i.e., weighting) the blue edges in such a way that the total weight of the blue edges selected in a minimum spanning tree of the resulting graph is maximized. \stack \ is known to be \apx-hard already when the number of distinct red weights is 2. In this paper we analyze some meaningful specializations and generalizations of \stack, which shed some more light on the computational complexity of the problem. More precisely, we first show that if $G$ is restricted to be \emph{complete}, then the following holds: (i) if there are only 2 distinct red weights, then the problem can be solved optimally (this contrasts with the corresponding \apx-hardness of the general problem); (ii) otherwise, the problem can be approximated within $7/4 + ε$, for any $ε> 0$. Afterwards, we define a natural extension of \stack, namely that in which blue edges have a non-negative \emph{activation cost} associated, and it is given a global \emph{activation budget} that must not be exceeded when pricing blue edges. Here, after showing that the very same approximation ratio as that of the original problem can be achieved, we prove that if the spanning tree of red edges can be rooted so as that any root-leaf path contains at most $h$ edges, then the problem admits a $(2h+ε)$-approximation algorithm, for any $ε> 0$.

preprint2014arXiv

The Max-Distance Network Creation Game on General Host Graphs

In this paper we study a generalization of the classic \emph{network creation game} in the scenario in which the $n$ players sit on a given arbitrary \emph{host graph}, which constrains the set of edges a player can activate at a cost of $α\geq 0$ each. This finds its motivations in the physical limitations one can have in constructing links in practice, and it has been studied in the past only when the routing cost component of a player is given by the sum of distances to all the other nodes. Here, we focus on another popular routing cost, namely that which takes into account for each player its \emph{maximum} distance to any other player. For this version of the game, we first analyze some of its computational and dynamic aspects, and then we address the problem of understanding the structure of associated pure Nash equilibria. In this respect, we show that the corresponding price of anarchy (PoA) is fairly bad, even for several basic classes of host graphs. More precisely, we first exhibit a lower bound of $Ω(\sqrt{ n / (1+α)})$ for any $α= o(n)$. Notice that this implies a counter-intuitive lower bound of $Ω(\sqrt{n})$ for very small values of $α$ (i.e., edges can be activated almost for free). Then, we show that when the host graph is restricted to be either $k$-regular (for any constant $k \geq 3$), or a 2-dimensional grid, the PoA is still $Ω(1+\min\{α, \frac{n}α\})$, which is proven to be tight for $α=Ω(\sqrt{n})$. On the positive side, if $α\geq n$, we show the PoA is $O(1)$. Finally, in the case in which the host graph is very sparse (i.e., $|E(H)|=n-1+k$, with $k=O(1)$), we prove that the PoA is $O(1)$, for any $α$.