Crossing-free paths in the square grid

被引:2
作者
Comic, Lidija [1 ]
Magillo, Paola [2 ]
机构
[1] Univ Genoa, DIBRIS, Genoa, Italy
[2] Univ Novi Sad, Fac Tech Sci, Novi Sad, Serbia
来源
COMPUTERS & GRAPHICS-UK | 2023年 / 114卷
关键词
Digital geometry and topology; Digital curves; Square grid; Self-crossing paths; Skip lists;
D O I
10.1016/j.cag.2023.06.015
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We consider paths in the 2D square grid, composed of grid edges, given as a sequence of moves in the four cardinal compass directions, without U-turns, but possibly passing several times through the same vertex or the same edge (if the path is open, it cannot pass twice through its starting vertex). We propose an algorithm which reports a self-crossing if there is one, or otherwise draws the path without self-crossings. The algorithm follows the intuitive idea naturally applied by humans to draw a curve: at each vertex that has already been visited, it tries to insert two new segments in such a way that they do not cross the existing ones. If this is not possible, a self-crossing is reported. This procedure is supported by a data structure combining a doubly-linked circular list and a skip list. The time and space complexity is linear in the length of the path. & COPY; 2023 Elsevier Ltd. All rights reserved.
引用
收藏
页码:296 / 305
页数:10
相关论文
共 24 条
[21]   Synthesis and Crystal Structure of an Expanded Square Grid Metal Organic Material, [Cu(L1)(DMF)]n•(2.64 DMF) [J].
Nugent, Patrick ;
Wojtas, Lukasz ;
Zaworotko, Michael J. .
JOURNAL OF CHEMICAL CRYSTALLOGRAPHY, 2011, 41 (12) :1834-1838
[22]   Hydrothermal Synthesis and Crystal Structure of a Square Grid Coordination Copper(II) Polymer from 1,4-Bis(imidazole-1-ylmethyl)benzene [J].
李涛 ;
胡胜民 ;
李志华 ;
杜少武 .
Chinese Journal of Structural Chemistry, 2006, (01) :85-89
[23]   Hydrothermal synthesis and crystal structure of a square grid coordination copper(II) polymer from 1,4-bis(imidazole-1-ylmethyl)benzene [J].
Li, T ;
Hu, SM ;
Li, ZH ;
Du, SW .
CHINESE JOURNAL OF STRUCTURAL CHEMISTRY, 2006, 25 (01) :85-89
[24]   New crystalline framework formed from a podal ligand with S2O2 donor and CuI:: non-interpenetrating square-grid with cubane-like CU4I4 cluster nodes [J].
Kim, TH ;
Lee, KY ;
Shin, YW ;
Moon, ST ;
Park, KM ;
Kim, JS ;
Kang, YJ ;
Lee, SS ;
Kim, J .
INORGANIC CHEMISTRY COMMUNICATIONS, 2005, 8 (01) :27-30