A BACKTRACKING APPROACH FOR SOLVING PATH PUZZLES

Joshua Erlangga Sakti, Muhammad Arzaki, G. S. Wulandari
{"title":"A BACKTRACKING APPROACH FOR SOLVING PATH PUZZLES","authors":"Joshua Erlangga Sakti, Muhammad Arzaki, G. S. Wulandari","doi":"10.14710/jfma.v6i2.18155","DOIUrl":null,"url":null,"abstract":"We study algorithmic aspects of the Path puzzle--a logic puzzle created in 2013 and confirmed NP-complete (Non-deterministic Polynomial-time-complete) in 2020. We propose a polynomial time algorithm for verifying an arbitrary Path puzzle solution and a backtracking-based method for finding a solution to an arbitrary Path puzzle instance.To our knowledge, our study is the first rigorous investigation of an imperative algorithmic approach for solving Path puzzles. We prove that the asymptotic running time of our proposed method in solving an arbitrary Path puzzle instance of size $m \\times n$ is $O(3^{mn})$. Despite this exponential upper bound, experimental results imply that a C++ implementation of our algorithm can quickly solve $6 \\times 6$ Path puzzle instances in less than 30 milliseconds with an average of 3.02 milliseconds for 26 test cases. We finally prove that an $m \\times n$ Path puzzle instance without row and column constraints is polynomially solvable in $O(\\max\\{m,n\\})$ time.","PeriodicalId":359074,"journal":{"name":"Journal of Fundamental Mathematics and Applications (JFMA)","volume":"102 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-11-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Fundamental Mathematics and Applications (JFMA)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.14710/jfma.v6i2.18155","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

We study algorithmic aspects of the Path puzzle--a logic puzzle created in 2013 and confirmed NP-complete (Non-deterministic Polynomial-time-complete) in 2020. We propose a polynomial time algorithm for verifying an arbitrary Path puzzle solution and a backtracking-based method for finding a solution to an arbitrary Path puzzle instance.To our knowledge, our study is the first rigorous investigation of an imperative algorithmic approach for solving Path puzzles. We prove that the asymptotic running time of our proposed method in solving an arbitrary Path puzzle instance of size $m \times n$ is $O(3^{mn})$. Despite this exponential upper bound, experimental results imply that a C++ implementation of our algorithm can quickly solve $6 \times 6$ Path puzzle instances in less than 30 milliseconds with an average of 3.02 milliseconds for 26 test cases. We finally prove that an $m \times n$ Path puzzle instance without row and column constraints is polynomially solvable in $O(\max\{m,n\})$ time.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
解决路径谜题的回溯方法
我们研究了 "路径谜题 "的算法问题。"路径谜题 "是2013年提出的一个逻辑谜题,2020年被确认为NP完备(非确定性多项式时间完备)。我们提出了一种验证任意路径谜题解的多项式时间算法,以及一种为任意路径谜题实例寻找解的基于回溯的方法。据我们所知,我们的研究是对解决路径谜题的命令式算法方法的首次严格研究。我们证明,在解决大小为 $m \times n$ 的任意路径谜题实例时,我们提出的方法的渐进运行时间为 $O(3^{mn})$。尽管存在这个指数级上限,但实验结果表明,我们算法的C++实现可以在30毫秒内快速解决大小为 $6 \times 6$ 的路径谜题实例,26个测试案例的平均时间为3.02毫秒。最后,我们证明了一个没有行列约束的 $m times n$ 路径谜题实例可以在 $O(\max\{m,n\})$ 时间内多项式求解。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
A BACKTRACKING APPROACH FOR SOLVING PATH PUZZLES MATHEMATICAL MODEL OF MEASLES DISEASE SPREAD WITH TWO-DOSE VACCINATION AND TREATMENT FROZEN INITIAL LIABILITY METHOD TO DETERMINE NORMAL COST OF PENSION FUND WITH VASICEK INTEREST RATE MODEL TOPOLOGY OF QUASI-PSEUDOMETRIC SPACES AND CONTINUOUS LINEAR OPERATOR ON ASYMMETRIC NORMED SPACES FLOWER POLLINATION ALGORITHM (FPA): COMPARING SWITCH PROBABILITY BETWEEN CONSTANT 0.8 AND DOUBLE EXPONENTGUNAKAN DOUBLE EXPONENT
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1