SearcharxivSearch

FIND YOUR NEXT DISCOVERY

Search the archive

Original records, connected by a shared subject.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

39 recordsLinked to original sources

Twelve Simple Algorithms to Compute Fibonacci Numbers

The Fibonacci numbers are a sequence of integers in which every number after the first two, 0 and 1, is the sum of the two preceding numbers. These numbers are well known, and the algorithms to compute them are simple enough that they are often used in introductory algorithms courses. In this paper, we present twelve such algorithm together with their time and space complexity analyses. Though very simple, these algorithms illustrate eleven concepts from the algorithms field, ranging from top-down vs. bottom-up dynamic programming to recursion depth, and we say which algorithms illustrate which concept. We also present the results of a small-scale experimental comparison of their runtimes on a personal laptop, where the slowest algorithm takes about four orders of magnitude longer than the fastest. Finally, we provide a list of homework questions for students. We hope that this paper can serve as a useful resource for students learning the basics of algorithms.

cs.DS

Unrestricted Boolean Multiplicative Complexity of Four-Term Binary Polynomial Multiplication: Rational Places, Hasse Jets, and the Failure of Nonlinear Feedback

Classical lower bounds show that multiplying two degree-three polynomials over $\mathbb F_2$ requires nine scalar products in bilinear or quadratic models. They do not settle unrestricted Boolean multiplicative complexity: an XOR--AND circuit may reuse nonlinear intermediate wires, and Boolean equality is taken modulo $x_i^2=x_i$, so a multiplication can lower algebraic degree. Let $\operatorname{Mul}_4:\mathbb F_2^8\to\mathbb F_2^7$ output the seven coefficients of the product of two four-term binary polynomials. We prove that its unrestricted XOR--AND multiplicative complexity is exactly nine. This resolves, for a natural vector-valued quadratic function, the Boyar--Find question of whether a quadratic-circuit lower bound can persist against unrestricted nonlinear reuse. The proof is structural rather than exhaustive. A useful purely quadratic prefix is forced onto the three rational places of $\mathbb P^1(\mathbb F_2)$. In a hypothetical eight-AND circuit, the unique non-useful gate must carry a cubic high part. Any useful continuation then forces a rational tangent and exposes a first Hasse jet, while exterior jet separation together with Boolean idempotence prevents the same defect from exposing the second Hasse jet. The required useful suffix therefore cannot exist. A complete Lean 4 formalization verifies the Boolean-ANF semantics, the unrestricted circuit model, and the exact theorem; it uses no project-specific axiom or native decision procedure. The same zero-defect flag argument gives multiplicative complexity six for three-term multiplication, and the method isolates the multi-defect obstruction for five terms.

cs.CC

Beating Quadratic Time--Message Trade-off in Distributed Minimum Spanning Tree Construction

We present a new distributed algorithm for computing a minimum spanning tree (MST) in the \textsf{CONGEST-KT$_{1}$} model, where messages are limited to $O(\log n)$ bits and each vertex initially knows the identifiers of its neighbors. Our algorithm exposes a two-parameter time--message trade-off: for any $0 \leq λ\leq κ\leq 1/2$, it runs in $\tilde{O}(n^λD_G + n^{1 - κ- λ} + n^{1 - 2κ+ λ} + n^{1/2})$ rounds and uses $\tilde{O}(\min\{m, n^{1 + κ}\})$ messages, where $n$, $m$, and $D_G$ are the number of vertices, edges, and thenetwork diameter, respectively. In particular, setting $(κ, λ) = (1/3, 1/6)$ yields an MST algorithm running in $\tilde{O}(n^{1/2} + n^{1/6}D_G)$ rounds with only $\tilde{O}(n^{4/3})$ messages. Under the mild assumption $D_G = O(n^{1/3})$, this is round-optimal while improving the best known message bound of $\tilde{O}(n^{3/2})$. More broadly, our algorithm breaks the quadratic time--message trade-off barrier $\mathrm{\# rounds} \cdot \mathrm{\# messages} = \tildeΩ(n^2)$, which no previous MST algorithm in the \textsf{CONGEST-KT$_{1}$} model has been able to overcome, and it does so for almost the entire range of the diameter $D_G$. As a byproduct, we also obtain new low-message broadcast, spanning-tree, and leader-election algorithms.

cs.DS

Diversity-Fair Online Selection

Online selection problems arise in applications such as crowdsourcing and recruitment, where decision makers may seek representation across multiple, potentially overlapping demographic or skill dimensions. We study diversity-fair online selection under adversarial arrivals. A recruiter must immediately and irrevocably decide whether to accept each candidate while selecting at most \(K\) candidates. Before arrivals begin, the recruiter observes aggregate marginal information: the total number of candidates contributing to each of the \(d\) diversity dimensions. When the candidate pool is large, this information may be estimated from demographic statistics of the applicant population. We evaluate the expected utilities across dimensions using the generalized mean \(M_p=(d^{-1}\sum_{k=1}^d U_k^p)^{1/p}, -\infty\le p\le 1,\) where \(U_k\) denotes the expected utility of dimension \(k\). We first study max-min fairness, corresponding to \(p=-\infty\). We prove that no online policy can achieve a competitive ratio better than \(O(1/\sqrt d)\) and develop a policy with a competitive ratio \(1/[4(2+\sqrt2)\sqrt d]\), establishing the optimal dependence on \(d\) up to a constant factor. Without exact marginal information, the optimal worst-case rate falls to \(Θ(1/d)\), demonstrating the value of this information. We also extend the max-min analysis to nonbinary attributes and characterize the optimal dependence on their value range. Finally, we study generalized-mean objectives. For \(0\le p\le1\), we establish an optimal competitive ratio of \(Θ(1/\log d)\). For each fixed finite negative mean \(p=-q\), where \(q>0\), our policy achieves \(d^{-q/(2q+1)}\) up to polylogarithmic factors, matching the exponent of the corresponding impossibility bound.

econ.TH

On the Parameterized Complexity of $s$-Club Cluster Edge Deletion

We study the parameterized and kernelization complexity of the \emph{\textsc{$s$-Club Cluster Edge Deletion}} problem, a distance-bounded generalization of \emph{\textsc{Cluster Edge Deletion}}. Given a graph $G=(V,E)$ and integers $k,s$, the goal is to delete at most $k$ edges so that every resulting connected component has diameter at most $s$. On the structural side, we settle an open question of Montecchiani, Ortali, Piselli, and Tappini (\emph{Theoretical Computer Science}, 2023) by proving W[1]-hardness parameterized by pathwidth plus the maximum number of allowed $s$-clubs, and consequently by treewidth plus this parameter. Thus, the diameter bound $s$ is inecessary for tractability under these parameters. In contrast, we show that dependence on \(s\) is unnecessary for several structural parameters: the problem is fixed-parameter tractable when parameterized by treedepth, neighborhood diversity, or cluster vertex deletion number, generalizing known results for $s=1.$ We further prove that no polynomial kernel exists when parameterized by vertex cover, even for $s=2$. On the positive side, we present an FPT bicriteria approximation scheme for graphs excluding long induced cycles, running in time $f(k,1/ε)\cdot n^{\mathcal{O}(1)}$ and producing a solution of size at most $k$ whose components have diameter at most $(1+ε)s$. Finally, we initiate the study of the directed variant, \textsc{$s$-Club Cluster Arc Deletion}, and prove that it is W[1]-hard parameterized by $k$, even on directed acyclic graphs.

cs.DM

Sublinear Edge Fault-Tolerant Hyperspanners for Hypergraphs

In this paper, we initiate the study on fault-tolerant (FT) graph spanners for hypergraphs and show the generalization to hypergraphs in the FT setting is non-trivial. An FT spanner approximates shortest distances under network failures, widely used in applications such as routing and distributed computing. We first provide a systematic study on extending spanners to hyperspanners in both non-faulty and FT settings and reveal that the latter case is more interesting: simple methods can only produce a linear size in the number of allowed faults $f$, while all known optimal sizes of FT graph spanners are sublinear in $f$. Inspired by the FT clustering technique in Parter's paper \cite{partervft}, we propose a hypergraph clustering based algorithm with an improved sublinear size bound. Specifically, for an $n$-node $m$-edge hypergraph with rank $r$ and a stretch parameter $k$, our algorithm constructs edge FT (EFT) hyperspanners of stretch $2k-1$ and size $O(k(k+r)f^{1-1/(rk)}n^{1+1/k}\log n)$ with high probability in time $\widetilde{O}(mr^3+nrf)$ ($\widetilde{O}$ hides polylogarithmic factors). We also establish size lower bounds, $Ω((f/r)^{r-1-1/k+o(1)}n^{1+1/k-o(1)})$ for vertex FT (VFT) hyperspanners and $Ω(f^{1-1/r-1/(rk)+o(1)}n^{1+1/k-o(1)}+fn)$ for EFT hyperspanners, leaving a gap of $k(k+r)f^{1/r}$ yet to close. We believe that this work will spark interest in developing optimal-sized FT hyperspanners for hypergraphs.

cs.DS

Sensitivity and Size Relationships of the Lempel-Ziv Factorization

The Lempel-Ziv (LZ) factorization is one of the most fundamental methods for compressing highly repetitive strings, and the number of phrases in its factorization is considered a repetitiveness measure. Sensitivity to an edit operation measures the maximum increase in a repetitiveness measure when the operation is applied to a string. While asymptotically tight bounds are known for the sensitivity of the LZ factorization to single-character edits, whether its multiplicative sensitivity is bounded by a constant has remained open for operations that change a large part of the structure of a string, such as prefix deletion, substring deletion, cyclic rotation, and string reversal. We resolve this question. For each of these four operations, we construct a family of strings in which a string of length $n$ has sensitivity $Ω(\log n)$ to that operation. We also determine the size relationships among the LZ factorization, collage systems and the lex-parse. We construct a family of strings whose LZ factorizations are $Ω(\log n)$ times larger than their minimum collage systems, and a family of strings whose lex-parses are $Ω(\log n)$ times larger than their LZ factorizations. Furthermore, we prove that there exists a family of strings for which every LZ encoding of height $O({\rm poly}\,\log n)$ is $Ω(\log n / \log \log n)$ times larger than the standard LZ factorization. Except for the lower bound on height-bounded LZ encodings, all of these lower bounds are asymptotically tight, matching $O(\log n)$ upper bounds.

cs.DS

From b-Coloring to $b^*$-Coloring: Large Girth and Parameterized Complexity

A b-coloring is a proper vertex coloring such that every color class contains a vertex, a so-called b-vertex, which sees all colors in its closed neighborhood. This type of coloring has been intensively studied from both structural and algorithmic point of view. Recently, Zaker [DAM 2025] introduced the notion of a b*-coloring, which is a b-coloring in which there is a vertex that sees a b-vertex of every color in its closed neighborhood. The b*-chromatic number is the maximum integer k such that there is a b*-coloring with k colors. We partially answer a question posed by Zaker and prove that graphs of girth at least 7 are b*-monotonic, which means that the b*-chromatic number does not increase by taking an induced subgraph. In addition, we discover a class of d-regular graphs of girth at least 5 with b*-chromatic number d+1, which strengthens a result about b-colorings by Dettlaff, Furmańczyk, Peterin, Roux, and Ziemann [AMC 2024]. We also study the parameterized complexity of finding b*-colorings, and show that for many structural parameters, the complexity coincides with that of finding b-colorings. In particular, the b*-chromatic number can be computed in polynomial time on any class of bounded clique-width. For most parameters, the translation from b-colorings is straightforward but for the feedback edge number, the FPT algorithm for b*-colorings is actually much simpler than that for b-colorings by Balabán [MFCS 2026].

cs.DM

Adversarial Online Classification with a Preview

Worst-case online classification is governed by sequential complexity, such as Littlestone dimension, and can be impossible even for statistically simple classes, such as thresholds of VC dimension one. We study a preview model in which an oblivious adversary fixes an entire labeled sequence of length $T$, a uniformly random subset of size $pT$ is revealed before prediction begins, and the remaining $(1-p)T$ examples are then presented in their original adversarial order. Against the best full-sequence hypothesis evaluated on the unrevealed examples, we characterize the dependence on the preview rate $p$: for binary classes of VC dimension $d$, the optimal excess loss is $Θ(d/p+\sqrt{dT})$, up to the trivial cap at $T$; for multiclass classes we obtain the corresponding $\widetilde O(d_{\rm DS}/p+\sqrt{d_{\rm Nat}T})$ bound with no dependence on the number of labels. Thus a random preview can replace worst-case sequential complexity by classical statistical dimensions without randomizing the online order. To achieve the sharp binary bound, our ChainedPrediction algorithm uses an online analogue of chaining, implemented as a multiscale aggregation algorithm rather than only as an analytic argument.

cs.LG

FirstFit online coloring in the random order model

The average performance of FirstFit online coloring on trees in the random order model is completely determined in recent works of Frei et al. and Bosek et al., showing $Θ(\log n /\log\log n)$ number of colors, improving the $Θ(\log n)$ colors in the adversarial model. We provide a few further results on slightly more general graph classes. Firstly, we extend their method to obtain a simple path-counting principle for sparse graph classes, which immediately yields for example that cactus graphs and uniform hypertrees exhibit a similar improvement. We then show that FirstFit uses only $O(1)$ colors on crown graphs, a standard example where adversarial arrival forces $Θ(n)$ colors. We further show that density alone (even linear minimum degree) is insufficient to guarantee $O(1)$ colors even on bipartite graphs. Finally, we identify graph classes, including unit interval graphs and some graphs of high chromatic number, for which random arrival provides only limited improvement. We end with some open problems.

cs.DS

Socially Fair Clustering: Parameterized Approximation and Local Search

We study the Socially Fair Clustering problem introduced by Abbasi, Bhaskara, and Venkatasubramanian (2021) and Ghadiri, Samadi, and Vempala (2021), along with its extension, the $(p,q)$-Socially Fair Clustering problem. This problem generalizes $k$-medians and $k$-means to settings where data points are partitioned into $\ell$ groups, and the goal is to find a fair clustering that is simultaneously good for all groups. We present several algorithms for this problem. For $\ell_p$-Socially Fair Clustering, we give the first constant-factor FPT-approximation parameterized by the number of groups $\ell$, resolving the open question raised by Ghadiri, Singh, and Vempala (2022). Our main ingredient is a new algorithm for closing additional centers in parameterized time inspired by local search. We then turn to the more general $(p,q)$-Socially Fair Clustering problem. The known algorithm for this problem, proposed by Chlamtáč, Makarychev, and Vakilian (2022) achieves a very good approximation but is complex, slow and difficult to implement. We analyze the performance of a simple local search algorithm and show that it provides an $O(q)$ approximation in the worst case. Finally, we design approximation algorithms for the facility location variant of the problem, where the number of facilities (centers) is not fixed in advance, and opening each facility incurs an opening cost. Unlike in previous work, we do not assume these opening costs are the same for all groups.

cs.DS

Constructive Characterization and Recognition Algorithm for Grafts with a Connected Minimum Join

Minimum joins in a graft $(G, T)$, also known as minimum $T$-joins of a graph $G$, are said to be connected if they determine a connected subgraph of $G$. Grafts with a connected minimum join have gained interest ever since Middendorf and Pfeiffer showed that they satisfy Seymour's min-max formula for joins and $T$-cut packings; that is, in such grafts, the size of a minimum join is equal to the size of a maximum packing of $T$-cuts. In this paper, we provide a constructive characterization of grafts with a connected minimum join. We also obtain a polynomial time algorithm that decides whether a given graft has a connected minimum join and, if so, outputs one. Our algorithm has two bottlenecks; one is the time required to compute a minimum join of a graft, and the other is the time required to solve the single-source all-sink shortest path problem in a graph with conservative $\pm 1$-valued edge weights. Thus, our algorithm runs in $O(n(m + n\log n) )$ time. In the nondense case, it improves upon the time bound for this problem due to Sebő and Tannier that was introduced as an application of their results on metrics on graphs.

cs.DM

Spectral and combinatorial methods for efficiently computing the rank of unambiguous finite automata

A zero-one matrix is a matrix with entries from $\{0, 1\}$. We study monoids containing only such matrices. A finite set of zero-one matrices generating such a monoid can be seen as the matrix representation of an unambiguous finite automaton, an important generalisation of deterministic finite automata which shares many of their good properties. Let $\mathcal{A}$ be a finite set of $n \times n$ zero-one matrices generating a monoid of zero-one matrices, and $m$ be the cardinality of $\mathcal{A}$. We study the computational complexity of computing the minimum rank of a matrix in the monoid generated by $\mathcal{A}$. By using linear-algebraic techniques, we show that this problem is in $\textsf{NC}$ and can be solved in $\mathcal{O}(mn^4)$ time and $\mathcal{O}(n^2)$ space. We also provide a combinatorial algorithm finding a matrix of minimum rank in $\mathcal{O}(mn^4)$ time and $\mathcal{O}(n^3)$ space. As a byproduct, we show a very weak version of a generalisation of the Černý conjecture: there always exists a straight line program of size $\mathcal{O}(n^2)$ describing a product resulting in a matrix of minimum rank. For the special case corresponding to total DFAs (that is, for the case where all matrices have exactly one 1 in each row), the minimum rank is the size of the smallest image of the set of all states under the action of a word. Our combinatorial algorithm finds a matrix of minimum rank in time $\mathcal{O}(n^3 + mn^2)$ in this case.

cs.FL

Automated Lower Bounds for Bilinear Complexity over Finite Fields

We present a general, automated framework for proving lower bounds on the bilinear complexity (tensor rank) of multiplication problems over a finite field $\mathbb{F}_q$. The framework is parameterized only by the multiplication tensor and by a group of rank-preserving symmetries acting on one argument: it classifies the subspaces of the argument into orbits under the group, runs a dynamic program over the orbits combining four lower-bound techniques, and emits a proof certificate that a verifier rechecks, typically faster than the search. Instantiating the framework for matrix multiplication, we improve the lower bounds for three small formats over $\mathbb{F}_2$, most notably showing that the bilinear complexity of multiplying two $3 \times 3$ matrices over $\mathbb{F}_2$ is at least $20$, raising the bound of $19$ that had stood since Bläser (2003). Instantiating it for polynomial multiplication, we obtain eighteen new lower bounds over $\mathbb{F}_2$ and $\mathbb{F}_3$, for the full product, cyclic convolution, and the truncated (modulo $x^N$) and negacyclic (modulo $x^N+1$) products. Every bound is backed by a machine-checkable certificate.

cs.CC

Smallest Enclosing Disk Queries Using Farthest-Point Voronoi Diagrams

Let $S$ be a set of $n$ points in $\mathbb{R}^2$. Our goal is to preprocess $S$ to efficiently compute the smallest enclosing disk of the points in $S$ that lie inside an axis-aligned query rectangle. Previous data structures for this problem achieve a query time of $O(\log^6 n)$ with $O(n \log^2 n)$ preprocessing time and space by lifting the points to 3D, dualizing them into polyhedra, and searching through their intersections. We present a significantly simpler approach, solely based on 2D geometric structures, specifically 2D farthest-point Voronoi diagrams. Our approach achieves a deterministic query time of $O(\log^4 n)$ and, via randomization, an expected query time of $O(\log^{5/2} n \log\log n)$ with the same preprocessing bounds.

cs.CG

A Deterministic Constant-Competitive Algorithm for Dynamic Mixture-of-Experts Serving

Dynamic Mixture-of-Experts Serving allocates k replica GPUs among m experts as workloads change. At each round, the online algorithm sees the current workload, chooses integral replica counts, and pays bottleneck service cost plus replica movement. It does not know future workloads. Huang, Lou, and Xiao gave an O(sqrt(log k))-competitive randomized algorithm for this problem. We prove a deterministic O(1)-competitive algorithm. For every number of experts and every k>=1, the algorithm satisfies ALG_det <= 10 C_PB OPT + (5 C_PB + 8) k + 16, where C_PB is the absolute constant from Chasing Positive Bodies at resource augmentation one and covering sparsity two. Consequently, CR_det(k)<=10 C_PB for every k>=1, so CR_det(k)=Theta(1). The multiplicative factor does not depend on the number of experts, replica budget, horizon, or workload values. Thus randomization is not needed for the asymptotic guarantee. The proof has two layers. A finite tangent envelope, summable positive resets, and a nonexpansive balanced projection reduce reciprocal-max service costs to a deterministic exact-budget fractional path. A new deterministic rounding theorem converts every such path to integral allocations with service distortion three and movement bounded by the fractional movement plus 6k. The complete reduction, rounding theorem, causal composition, and quantified main theorem are machine-checked in Lean 4 relative to the positive-body result as the sole scientific source premise. The theorem concerns the allocation model above. It does not include network topology, shared-edge congestion, or routing decisions.

cs.DS

Hardness of Approximation of Rank Aggregation on Ulam Metric

We study the approximability of rank aggregation under the Ulam metric. In the \emph{Ulam median} problem, the goal is to find a permutation minimizing the sum of its Ulam distances to the input permutations, while in the \emph{Ulam center} problem the objective is to minimize the maximum such distance. Both problems are known to be NP-hard, but no explicit approximation hardness was previously known. We prove that, for every $\varepsilon>0$, it is NP-hard to approximate either Ulam median or Ulam center within a factor of $51/50-\varepsilon$, even when the input consists of only four permutations. We further show that unless P = NP, neither problem admits a polynomial-time additive approximation scheme. The hardness result for Ulam median is established via a reduction from MAX-E3-LIN-2. The corresponding hardness for Ulam center is then obtained through a reduction from Ulam median.

cs.CC

A Simplified Analysis of the Good-Bad $3/2$-Approximation Algorithm for Some Minimum-Cost Graph Problems

In this paper, we consider an easy greedy approximation algorithm, the good-bad algorithm, introduced by Couëtoux for finding a minimum-cost set of edges such that every connected component has at least $k$ vertices. Couëtoux proves that the good-bad algorithm achieves a $3/2$-approximation for this problem. Davis and Williamson extend this result to the more general problem of finding a minimum-cost edge set that contains at least one edge from every cut $S\subseteq V$ satisfying $h(S) = 1$ where $h:2^V \rightarrow \{0,1\}$ is downward monotone; that is, $h(S) = 1$ implies $h(T) = 1$ for every nonempty subset $T \subseteq S$. The original problem corresponds to $h(S) =1$ when $|S|<k$. We give a simplified analysis of the good-bad algorithm for downward monotone functions.

cs.DS