共 24 条
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 条