CS Paper Radar

Estimating the number of nodes and paths in a DAG by following a random path

Günter Rote

cs.DS math.CO ·submitted 2026-10-28 10:15 UTC · v1

Abstract

We investigate a simple method to compute an unbiased estimate of the number of nodes of a directed acyclic graph (DAG) by following a random directed path. This method is due to Leonard Pitt from 1987, and it generalizes a method of D. E. Knuth from the 1960s for estimating the size of a rooted tree. A slight variation makes it possible to estimate the number of source-sink paths. We extend the algorithm to use many "agents" that walk cooperatively through the graph. This extension unifies and generalizes several methods that have been proposed for approximately counting the nodes of a tree.

Comment
28 pages, 5 figures, 10 tables, 4 appendices

Closest papers

Nearest neighbours by meaning across the whole index.

Approximate Counting of $k$-Paths in $O^*(2^k)$ Time

cs.DS ·2026-08-13 ·Tomohiro Koana
similarity 0.60
Abstract

We resolve the conjecture of Koutis and Williams that $k$-paths can be approximately counted in $O^*(2^k)$ time. For a simple directed graph with $n$ vertices and $m$ arcs, our randomized algorithm returns a $(1\pm\varepsilon)$-approximation with failure probability at most $δ$ in $O^*(2^k\varepsilon^{-2}\log(1/δ))$ time.

0.03

Counting Paths and Trees via Exterior Algebra

cs.DS ·2026-09-13 ·Fahad Panolan, Saket Saurabh, Meirav Zehavi, Jie Xue
similarity 0.60
Abstract · Counting k-paths, Counting k-trees, Exterior Algebra

We give randomized approximation algorithms for counting k-paths and k-forests in a host graph. Here k denotes the number of pattern vertices, n and m denote the numbers of host vertices and edges or arcs, ε is the relative error, and δ is the failure probability. Our main results are: 1. Paths: We approximate the number of directed paths on $k$ vertices in $2^k k^{O(1)}(n+m)\varepsilon^{-2}\log(2/δ)$ arithmetic operations. 2. Trees and forests: For every fixed $η>0$, we approximate the number of non-induced copies of a given forest on $k$ vertices in $(2+η)^k n^{O_η(1)}\varepsilon^{-2}\log(2/δ)$ arithmetic operations. Our path algorithm resolves a conjecture of Koutis and Williams~[CACM 2016] and answers an open question of Lokshtanov, Saurabh, and Zehavi~[SODA 2021] by giving a $2^k poly(n,\varepsilon^{-1})$-time approximation scheme. Our algorithms combine exterior algebra with random matrix estimators, using the tensor-train moment bound of Rakhshan and Rabusseau~[AISTATS 2020]. For forests, we use a small-component separator to evaluate the estimator efficiently.

0.04

Efficiently Estimating Cycle Statistics on Graphs via Spanning Trees

cs.SI stat.CO ·2026-11-05 ·Josef Hoppe, Michael T. Schaub
code/data similarity 0.59
Abstract · 15 pages, 8 figures, plus appendix

Simple cycles encode feedback and alternative routes in networks and are important for routing problems, the convergence of dynamical processes on networks, message passing and belief propagation, or even static network characterizations such as structural balance in signed networks. Being able to assess and sample from the cycle structure of a graph is thus of interest in many analysis contexts. However, due to the combinatorial growth of the cycle space with graph size, the computational cost for such sampling is high. Therefore, we here introduce a sampling framework that enables us to sample from the cycle structure without enumerating all cycles. Specifically, the method draws uniform spanning trees and collects the fundamental cycles created by their non-tree edges, such that each tree provides an informative subset of simple cycles. Because cycles are included with unequal probabilities and are dependent within each subset, we formulate an inclusion-probability-based Horvitz-Thompson estimator, which we average over random subsets, a procedure we call Monte Carlo Horvitz-Thompson. For this, we sample multiple Horvitz-Thompson estimators and introduce a method to further subsample the individual estimators for increased computational performance. For sampling cycles, the estimator is unbiased if exact cycle inclusion probabilities are known. To extend the method to larger networks, we derive an efficient mean-field approximation for the inclusion probabilities and characterize the graph regimes in which it remains accurate. Experiments on synthetic and real-world networks demonstrate the computational scaling and statistical performance of the framework. We then illustrate the utility of Monte Carlo Horvitz-Thompson estimation by estimating cycle counts and cycle-level frustration statistics in signed spin systems. An implementation is available in the py-raccoon package.

0.68

Path Length Existence Problems in Bounded-Treewidth Probabilistic Graphs

cs.DB cs.CC ·2026-10-13 ·Antoine Amarilli, Mikaël Monet, Harshul Sagar
hot direction similarity 0.58
Abstract · 42 pages

We consider the problem of computing the probability of existence of a source-to-target path or walk satisfying a given length constraint in an input probabilistic graph. The length constraints we consider can require the length to be at least $\ell$, at most $\ell$, or exactly $\ell$, for $\ell$ a target length given as input. The probabilistic graphs that we consider are directed graphs where each edge is annotated with an independent probability of existence. As this task is generally intractable (#P-hard), we aim for algorithms applying to input graphs that are assumed to be of bounded treewidth. We classify the complexity landscape of these problems: - We give an XP algorithm parameterised by treewidth to compute the probability that an input probabilistic graph contains a source-to-target path/walk of length $\geq \ell$, and do the same for a path/walk of length $\leq \ell$. - We show that the four problems mentioned in the last item are W[1]-hard parameterised by pathwidth (hence not FPT under the standard assumption that FPT$\neq$W[1]). This is in contrast to the case of non-probabilistic graphs, where the corresponding problems were known to be FPT parameterised by treewidth; and to the connectivity problem (and more generally MSO evaluation) on probabilistic graphs, where the same was known. - Surprisingly, we show that it is #P-hard to compute the probability that an input graph contains a source-to-target path/walk of length exactly $\ell$, even on graphs of pathwidth $2$. By contrast, all our problems are tractable on graphs of treewidth $1$. - Last, we investigate the complexity of our problems when the edges can carry weights. This causes all our problems to become #P-hard already on pathwidth-2 graphs, and causes specifically the ``exactly $\ell$'' walk problem to be #P-hard even on pathwidth-1 graphs.

0.32

A Simple Algorithm for the Directed Multiple Source Replacement Paths Problem

cs.DS ·2026-08-17 ·Kaito Harada, Taisuke Izumi
publishedtheory similarity 0.56
Abstract · 15 pages, 1 figure. To appear in SOSA 2027

In the replacement paths (RP) problem, we are given a graph $G = (V, E)$ with $n = |V|$ and $m = |E|$, together with two vertices $s, t \in V$, and are asked to compute the shortest-path distance from $s$ to $t$ in $G \setminus e$ for every failed edge $e \in E$. The multiple source replacement paths (MSRP) problem is its natural generalization: given a set $S \subseteq V$ of $σ$ sources, compute the replacement path distances for all pairs in $S \times V$. In this paper, we present a randomized combinatorial algorithm that solves MSRP on unweighted directed graphs in $\tilde{O}(m\sqrt{σn} + σn^2)$ time, with all the output distances correct with high probability. This improves the best known bound $\tilde{O}(m\min\{σ\sqrt{n}, n\} + σn^2)$ for directed graphs, which is obtained either by running the single source RP algorithm of Chechik and Magen [ICALP'20] from each source separately or by constructing and querying the all-pairs distance sensitivity oracle of Bernstein and Karger [STOC'09]. Our running time is essentially tight among combinatorial algorithms because Gupta, Jain, and Modi [PODC'20] proved a lower bound of $m{(σn)}^{1/2-o(1)}$ for such algorithms, which holds even on undirected graphs, and the additive term $σn^2$ is proportional to the time needed to write down the $Θ(σn^2)$ output distances. The algorithm is also remarkably simple.

0.41

Collective Tree Exploration with Predictions

cs.DS cs.MA ·2026-11-12 ·Romain Cosson, Yichen Huang, Michael Mitzenmacher, Ali Vakilian
benchmark similarity 0.56
Abstract

We study collective tree exploration with subtree-size predictions. In this problem, a team of $k$ mobile agents needs to explore an unknown rooted tree as fast as possible, and whenever a new vertex $u$ is discovered, the team receives a prediction $\hat n_u$ of the number of nodes $n_u$ in the subtree rooted at $u$. We provide algorithmic guarantees under two error measures: the maximum error $E=\max_u|\widehat n_u-n_u|$ and the multiplicative distortion $μ= (\max_u\widehat n_u/n_u)(\max_u n_u/\widehat n_u)$. For the maximum error, we present a deterministic algorithm that explores any tree with $n$ nodes and depth $D$ in $O(\text{OPT}+E)$ rounds, where $\text{OPT} = Θ(n/k+D)$ is the offline benchmark, and we show that there is no deterministic algorithm that admits an $O(\text{OPT})+o(E)$ guarantee. For the multiplicative distortion, we present several algorithms that induce a competitive ratio in $\widetilde O(\min\{ \sqrtμ\log k, μ\log\log k+μ^{1.5} \})$, where the $\widetilde O(\cdot)$ may hide logarithmic factors in $μ$.

0.17

Computation in Anonymous Directed Dynamic Networks: Exact Worst-Case Termination Time and Network-Wise Intractability

cs.DC ·2026-11-01 ·Giuseppe A. Di Luna, Giovanni Viglietta
theory similarity 0.55
Abstract · 37 pages, 3 figures

We determine the exact round complexity of Counting in anonymous directed dynamic networks. Agents have no identifiers, but $\ell\geq1$ of them are designated as leaders. Every agent knows $\ell$ and its own leader status, while the population size $n$ is unknown and has to be determined by the agents. Communication proceeds in synchronous rounds; the directed communication graph may change arbitrarily and unpredictably from one round to the next, but is assumed to remain strongly connected. We solve Counting with a distributed algorithm that makes every agent output $n$ and halt after a number of rounds equal to $\begin{cases} n&\text{if }n=\ell\\ 2n-1&\text{if }n>\ell\text{ and }\ell=1\\ 2n-2&\text{if }n>\ell\text{ and }\ell\geq2. \end{cases}$ The algorithm works even for networks with loops and parallel arcs and even when agents learn their outdegree only after sending. We prove that this bound is worst-case tight over directed multigraphs for every $n$ and $\ell$ with $1\leq\ell\leq n$. Moreover, the local computation is polynomial (provided that each communication multigraph has at most $2^{\operatorname{poly}(n)}$ arcs): in every round, each agent solves at most one linear system with up to $n$ variables. By standard techniques, solving Counting also enables the evaluation of any computable function of the multiset of agents' input values within $2n-1$ communication rounds. The bound above optimizes the worst case over all networks. For an individual network, we show that even deciding whether an agent already has enough local information to determine $n$ is $\mathsf{coNP}$-complete (provided that the numbers of parallel arcs are encoded in binary). Thus, worst-case-optimal Counting admits polynomial local computation, whereas exact network-wise optimization is intractable under standard complexity assumptions.

0.21

A graph decomposition approach for the synthesis of EMPs in directed acyclic networks

eess.SY ·2026-10-22 ·Eduardo Mapurunga, Michel Gevers, Alexandre Bazanella
unusual similarity 0.55
Abstract · Paper submitted to Automatica

This paper considers the identifiability of dynamical networks whose topology is a Directed Acyclic Graph (DAG), in the context where not all nodes are excited and not all nodes are measured. The objective is to construct a valid and parsimonious Excitation and Measurement Pattern (EMP), i.e. a selection of excited and measured nodes, that allows to identify the whole network with a small number of excitations and measurements. We show first that a DAG can be decomposed into a set of trees and parallel paths networks. We propose an algorithm that achieves this decomposition and computes an EMP that combines EMPs for the individual trees and parallel paths networks. We formally show that this algorithm yields an EMP capable of identifying the whole network.

0.34