A Linear Time and Space Algorithm for Detecting Path Intersection

For discrete sets coded by the Freeman chain describing their contour, several linear algorithms have been designed for determining their shape properties. Most of them are based on the assumption that the boundary word forms a closed and non-intersecting discrete curve. In this article, we provide a linear time and space algorithm for deciding whether a path on a square lattice intersects itself. This work removes a drawback by determining efficiently whether a given path forms the contour of a discrete figure. This is achieved by using a radix tree structure over a quadtree, where nodes are the visited grid points, enriched with neighborhood links that are essential for obtaining linearity.

[1]  Jacques-Olivier Lachaud,et al.  Combinatorial View of Digital Convexity , 2008, DGCI.

[2]  Donald E. Knuth,et al.  The art of computer programming, volume 3: (2nd ed.) sorting and searching , 1998 .

[3]  M. V. Wilkes,et al.  The Art of Computer Programming, Volume 3, Sorting and Searching , 1974 .

[4]  Isabelle Debled-Rennesson,et al.  Detection of the discrete convexity of polyominoes , 2000, Discret. Appl. Math..

[5]  Gilbert Labelle,et al.  Properties of the Contour Path of Discrete Sets , 2006, Int. J. Found. Comput. Sci..

[6]  Herbert Freeman,et al.  On the Encoding of Arbitrary Geometric Configurations , 1961, IRE Trans. Electron. Comput..

[7]  Grzegorz Rozenberg,et al.  Developments in Language Theory II , 2002 .

[8]  Srecko Brlek,et al.  On the tiling by translation problem , 2009, Discret. Appl. Math..

[9]  Gilbert Labelle,et al.  A Note on a Result of Daurat and Nivat , 2005, Developments in Language Theory.

[10]  Jon Louis Bentley,et al.  Quad trees a data structure for retrieval on composite keys , 1974, Acta Informatica.

[11]  Srecko Brlek,et al.  A linear time and space algorithm for detecting path intersection I , 2010 .

[12]  Xavier Provençal Combinatoire des mots, géométrie discrète et pavages , 2008 .

[13]  M. Lothaire Applied Combinatorics on Words (Encyclopedia of Mathematics and its Applications) , 2005 .

[14]  Azriel Rosenfeld,et al.  Picture Processing and Psychopictorics , 1970 .

[15]  Jacques-Olivier Lachaud,et al.  Lyndon + Christoffel = digitally convex , 2009, Pattern Recognit..

[16]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .

[17]  M. Lothaire,et al.  Applied Combinatorics on Words , 2005 .