Journal of Fundamental Mathematics and Applications (JFMA)
Vol 6, No 2 (2023)

A BACKTRACKING APPROACH FOR SOLVING PATH PUZZLES

Sakti, Joshua Erlangga (Unknown)
Arzaki, Muhammad (Unknown)
Wulandari, Gia Septiana (Unknown)



Article Info

Publish Date
27 Nov 2023

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.

Copyrights © 2023






Journal Info

Abbrev

jfma

Publisher

Subject

Decision Sciences, Operations Research & Management

Description

Journal of Fundamental Mathematics and Applications (JFMA) is an Indonesian journal published by the Department of Mathematics, Diponegoro University, Semarang, Indonesia. JFMA has been published regularly in 2 scheduled times (June and November) every year. JFMA is established to highlight the ...