A Linear Algorithm for the Random Sampling from Regular Languages

被引:19
作者
Bernardi, Olivier [2 ]
Gimenez, Omer [1 ]
机构
[1] Univ Politecn Cataluna, Barcelona, Spain
[2] MIT, Cambridge, MA 02139 USA
关键词
Random sampling; Regular languages; UNIFORM RANDOM GENERATION; CONTEXT-FREE LANGUAGE; COMBINATORIAL STRUCTURES; WORDS; OBJECTS;
D O I
10.1007/s00453-010-9446-5
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present the first linear algorithm for the random sampling from regular languages. More precisely, for generating a uniformly random word of length n in a given regular language, our algorithm has worst-case space bit-complexity O(n) and mean time bit-complexity O(n). The previously best algorithm, due to Denise and Zimmermann (Theor. Comp. Sci. 218(2):233-248, 1999), has worst-case space bit-complexity O(n (2)) and mean time bit-complexity O(nlog (n)). The Denise et al. algorithm was obtained by performing a floating-point optimization on the general recursive method formalized by Nijenhuis and Wilf (and further developed by Flajolet, Zimmermann and Van Cutsem). Our algorithm combines the floating-point optimization with a new divide-and-conquer scheme.
引用
收藏
页码:130 / 145
页数:16
相关论文
共 17 条
[1]  
Alonso L., 1995, RANDOM GENERATION TR
[2]  
[Anonymous], 1990, Introduction to Algorithms
[3]  
[Anonymous], 1978, COMBINATORIAL ALGORI
[4]  
Barcucci E, 1999, J DIFFER EQU APPL, V5, P435
[5]   Random generation of trees acid other combinatorial objects [J].
Barcucci, E ;
Del Lungo, A ;
Pergola, E .
THEORETICAL COMPUTER SCIENCE, 1999, 218 (02) :219-232
[6]   Random uniform generation of words in rational languages [J].
Denise, A .
THEORETICAL COMPUTER SCIENCE, 1996, 159 (01) :43-63
[7]   Uniform random generation of decomposable structures using floating-point arithmetic [J].
Denise, A ;
Zimmermann, P .
THEORETICAL COMPUTER SCIENCE, 1999, 218 (02) :233-248
[8]  
Denise A, 2000, TRENDS MATH, P113
[9]   Boltzmann samplers for the random generation of combinatorial structures [J].
Duchon, P ;
Flajolet, P ;
Louchard, G ;
Schaeffer, G .
COMBINATORICS PROBABILITY & COMPUTING, 2004, 13 (4-5) :577-625
[10]   A CALCULUS FOR THE RANDOM GENERATION OF LABELED COMBINATORIAL STRUCTURES [J].
FLAJOLET, P ;
ZIMMERMAN, P ;
VANCUTSEM, B .
THEORETICAL COMPUTER SCIENCE, 1994, 132 (1-2) :1-35