Computing thejth solution of a first-order query

Guillaume Bagan, Arnaud Durand, Etienne Grandjean, Frédéric Olive
2008 RAIRO - Theoretical Informatics and Applications  
We design algorithms of "optimal" data complexity for several natural problems about first-order queries on structures of bounded degree. For that purpose, we first introduce a framework to deal with logical or combinatorial problems R ⊂ I × O whose instances x ∈ I may admit of several solutions R(x) = {y ∈ O : (x, y) ∈ R}. One associates to such a problem several specific tasks : compute a random (for the uniform probability distribution) solution y ∈ R(x); enumerate without repetition each
more » ... ution yj in some specific linear order y0 < y1 < · · · < yn−1 where R(x) = {y0, . . . , yn−1}; compute the solution yj of rank j in the linear order <. Algorithms of "minimal" data complexity are presented for the following problems: given any first-order formula ϕ(v) and any structure S of bounded degree: (1) compute a random element of ϕ(S) = {a : (S, a) |= ϕ(v)}; (2) compute the j th element of ϕ(S) for some linear order of ϕ(S); (3) enumerate the elements of ϕ(S) in lexicographical order. More precisely, we prove that, for any fixed formula ϕ, the above problems 1 and 2 (resp. problem 3) can be computed within constant time (resp. with constant delay) after a linear (O(|S|)) precomputation. Our essential tool for deriving those complexity results is a normalization procedure of first-order formulas on bijective structures.
doi:10.1051/ita:2007046 fatcat:ab3ki2rkufa4hbk5l7bej7fmoy