A Comparative Study of Informed and Uninformed Sea
A Comparative Study of Informed and Uninformed Sea
Article history Abstract: Problems in artificial intelligence can be solved using intelligent
Received: 24-06-2021 tracking methods through intelligent search mechanisms. Understandably,
Revised: 31-08-2021 search algorithm performances are highly dependent on the problem solved.
Accepted: 09-10-2021 In this study, we evaluate and compare the performance of five uninformed and
Corresponding Author:
informed search (breadth-first search, depth first search, optimal search and
Wahyu Hidayat best first search using two heuristic functions, namely mismatched tile and
Department of Information Manhattan distance) algorithms to solve the eight-puzzle game problem.
System, School of Applied For each algorithm, the numbers of raised and explored nodes were
Science, Telkom University, assessed and analyzed. Our experiment demonstrates that informed
Bandung, Indonesia search with heuristic outperforms uninformed search significantly, both
Email: [email protected]
in terms of memory usage efficiency and computational power efficiency.
On average, the informed search using heuristic requires only 5.33% of
memory used by uninformed search and only 4.45% of computational
power demanded by uninformed search. Boxplot analysis also confirms
that informed search using heuristic also delivers more stable
performance contrasted to uninformed search. These could be a concern
for researchers and game developers to consider implementing the
heuristically enhanced search algorithm to utilize memory and
computational power efficiently to solve similar problems.
© 2021 Wahyu Hidayat, Fitri Susanti and Dedy Rahman Wijaya. This open access article is distributed under a Creative
Commons Attribution (CC-BY) 4.0 license.
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
informed search (represented by Best First Search) fast and safe food delivery by a robot (Navya and Ranjith,
algorithms to solve the 8-puzzle game problem. 2021) and even to find the path for the facility staff to
The 8-puzzle was one of the earliest heuristic search travel with the minimum cumulative radiation dose within
problems and it is a perfect case to compare informed with nuclear facilities (Chen et al., 2020). Meanwhile, some
uninformed search. With an average solution of 20 steps other research focus on attempting to solve multicriteria
and an average branching factor of 3, puzzle-8 can decision problem such as to assess the security (Kumar et al.,
easily cause an exhaustive uninformed search to find a 2021) (Kumar et al., 2021), durability (Sahu et al., 2020)
solution among almost 3.5 billion states (Russell and and reliability(Sahu et al., 2021) of software.
Norvig, 2020). Some research focuses on finding and developing new
Using the heuristic is much more promising because search algorithms or improving previously known
the number of unique possible states in 8-puzzle is algorithms. Meister (2020) proposed best first beam
much lower than the number of states that are evaluated search, which is an upgrade from a basic Beam search that
using an exhaustive uninformed search. is derived from Breadth-First Search. It is claimed to
Understandably, the number of evaluated states is perform ten times faster than basic Beam Search to solve
highly related to memory and computational power a decoding problem in a natural language processing task.
requirements. Thus, experimenting on the 8-puzzle by Hatem et al. (2018) propose a modification of the A*
evaluating the number of raised and explored nodes can search algorithm to solve large general-purpose problems
show the different performances among algorithms in using parallel external memory and disk-based search.
terms of memory and computational power efficiency. Iordan (2019) investigates Chebyshev distance, Hamming
The contribution of this study is to find which search distance and Manhattan distance heuristic to improve the
algorithm that provides the best performance to solve the A* search algorithm. Meanwhile, (Hu and Sturtevant,
8-puzzle problem both in terms of memory usage 2019) optimizes Breadth-First Search with an external
efficiency and in terms of computational power memory heuristic to build and store 5.8 trillion entries of
efficiency. By knowing the most efficient search heuristic pattern to solve the Rubik’s Cube problem.
algorithm, game developers can choose the right One of many ways to improve the performance of
algorithm to solve 8-puzzle problems and similar search algorithms is by adding a heuristic function to
searching and pathfinding problems in the field of make the algorithm smarter by emulating the way humans
computer game development. Thus, the games created think. Chowdhary (2020) describes various search
will be more efficient in terms of memory requirements algorithms that utilize heuristic, for instance, Hill-Climbing
and computational power requirements and can be applied search, A* Search and genetic algorithm-based search.
in devices with limited resources. Some heuristics can be applied in real-time and (Ismail and
Agwu, 2019) have investigated the effect of heuristic
Related Works function properties on traditional and real-time
heuristic search methods.
Intelligent tracking methods through an intelligent Due to so many variations among search algorithm
search mechanism can be used to solve various problems and their enhancements, some studies have done
and implemented in many different scenarios. Problems comparison studies to find the most effective and efficient
that can be solved using intelligent search are ranging search algorithm. Pathak et al. (2018) compares
from a very simple problem such as block architecture breadth-first search, depth first search, uniform cost
problem (Rahim et al., 2018a) to a more advanced search, A* and greedy search based on their time and
polyhedra puzzle (Iordan, 2018) and even up to space complexity, optimality and completeness. Iordan
sophisticated problems such as to help an unmanned air (2016) and (Menon and Amali, 2018) compare various
vehicle navigate using as efficient energy as possible search algorithms to solve the 8-puzzle problem. Iordan
(Debnath et al., 2019). (2016) measure the effective branching factor and
Gaming is one of many scenarios where intelligence running time to solve the puzzle while (Menon and
search is mostly used. For example, in a classic Amali, 2018) focus on the number of nodes explored
TicTacToe game (Hutahaean, 2018), an Indonesian and the time required to solve the puzzle.
popular traditional game of "Congklak" (Rahim et al.,
2018b) and general pathfinding task in the game
Methodology
(Zafar et al., 2018).
While some studies implement intelligent search in Eight-puzzle is a simple game consisting of eight tiles
gaming, other studies presented interesting that can be moved that are numbered 1 to 8 and placed on
implementations of intelligent search that are closer to a a "floor" measuring 3 × 3 tiles. One of the tiles of the
real-life scenario. Among them are the implementation of "floor" is always empty and any tiles next to it
intelligence search to facilitate smart shopping experience (horizontally or vertically) can be moved into that empty
in groceries using dynamic pathfinding (Ada et al., 2019), tile. The object of the game is to start from a certain
1148
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
configuration and end it with the tiles lying in order the node that is right next to its current parent, as
according to the number on them. illustrated in Fig. 2.
In this study, a various search algorithm is applied To apply the depth-first search method, the
to solve the 8-puzzle problem. We evaluate five search pseudo-code that is executed is as follows:
algorithms, namely breadth-first search, depth-first
search, optimal search and best-first search using two 1. Give the starting node to the open list L
heuristic functions; mismatched tile and Manhattan 2. Loop: If the open list L is empty, it means it failed
Distance function. 3. Put n at the beginning of the open list L
For each algorithm, the numbers of raised and 4. If n is a goal, then the tracking is successful
explored nodes are assessed and analyzed. The 5. Remove n from the open list L
distribution and the ratio of explored to raised nodes are 6. Expand n then assign all child nodes to the open head
also assessed to measure the performance and efficiency and add a pointer from the nth-child node
of each algorithm in terms of memory usage and 7. Back to Loop
computational power requirements.
Optimal Search
Breadth-First Search (BFS)
Breadth-first search and depth-first search only track
In the Breadth-First Search tracking method, all nodes
based on the position of the child of each level in the tree
at level n will be expanded first before visiting nodes at
diagram. One strategy that can be used to improve this is
level n+1. Tracing starts from the root node is continued
by prioritizing the nodes explored using additional
at the first level from left to right, then moves to the next
information. One of the additional information that can be
level is done the same thing.
used for tracking is the cost function calculation. The
Each time a node is visited, the conditions at that node
illustration of the optimal search method is shown in Fig. 3.
are matched with the conditions in the goal state. If the
In this study, the cost function C is the sum of the node
conditions at the visited node are different from the target
depth and the number of nodes explored to get from the
conditions, it means that a solution has not been found.
initial state to the current node, computed as follows:
The tracking process is then carried out on all nodes to a
predetermined depth.
Cp depth p E p (1)
On the other hand, if the condition of the visited node
is the same as the target condition, it means that a solution
has been found and the tracking is stopped. The illustration where, p is a vector of the current state and Ep is the
of the breadth-first search can be Fig. 1. number of nodes explored to get from the initial state to p.
To apply the Breadth-First Search method, the Based on the cost value information obtained in Fig. 3,
pseudo-code that is executed is as follows: the node chosen for the next situation is node N1, because
it has the lowest cost. To determine the next node, all
1. Give the starting node to the open list L raised nodes are sorted in ascending order based on their
2. Loop: If the open list L is empty, then tracking is cost function value, calculated using Eq. 1.
stopped The node that has the lowest total cost is selected. In
3. Put n at the beginning of the open list L this case, N5 which has a total cost of 2+2 = 4 is chosen
4. If n is a goal, then the tracking has been as the next explored node. This is repeated until the
successful desired goal state is reached.
5. Remove n from the open list L
6. Put n on the closed list C Best First Search
7. Expand n. Give the tail an open list L of all child Best first search works very similarly with optimal
nodes that have not appeared in open list L or search, but with a fundamental difference. In best first search,
closed list C and assign a pointer to n additional information that can be used to assist the tracking
8. Back to Loop process is not just the value of the cost. Another additional
information that can be used is the heuristic value.
Depth First Search (DFS) Best first search tries to mimic and emulate the human's
In the depth first search tracking method, the tracking approach in solving problems by using a heuristic function
process will be carried out on all the left nodes of the first that measures the likeliness of reaching the goal state from
child before tracking to nodes of the same level. This the currently evaluated state. In this method, it is possible to
process is repeated to a certain depth. If the depth limit return to the previous state if a solution fails to be obtained.
has not been found, then the tracking is continued at the This process is called the backtracking mechanism.
node that is right next to it and has one parent with it. If An example of a heuristic evaluation process of three
the node of one parent is exhausted, the trace continues to different states is given in Fig. 4.
1149
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
m p, q i 1 x
n
(2)
d p, q i 1 qi pi
n
(3)
Et GH t (5)
1150
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
1151
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
Fig. 5: Distribution of raised and explored nodes in breadth-first Fig. 8: Distribution of raised and explored nodes in best first
search search using mismatched tile
1152
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
1153
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
nodes is needed to be explored to solve the puzzle. This search algorithm relative to uninformed search
confirms that in solving 8-puzzle, in general, uninformed algorithms. Table 4 and 5 present the average percentage
search performs worse than informed search with of raised and explored nodes in best first search using the
heuristics, both in terms of memory usage and mismatched tile heuristic function and manhattan distance
computational power requirements. heuristic function, respectively.
Figure 12 shows the bar chart comparing the average Table 4 shows that to solve the same 8-puzzle
number of raised and explored nodes. It is clearly shown problem, best first search with mismatched tile heuristic
that both best first search using mismatched tile and function requires to raise only 4.92% nodes and explore
Manhattan distance heuristic functions raised and 4.15% nodes compared to the uninformed search of
explored far fewer nodes compared to breadth-first breadth-first search and depth first search.
search, depth first search and optimal search. This verifies Meanwhile, Table 5 shows that Best First Search with
that in terms of memory usage and computational power
Manhattan distance heuristic function requires to raise
requirements, informed search algorithms represented by
only 5.73% nodes and explore 4.76% nodes compared to
best first search significantly outperform breadth-first
search, depth first search and optimal search that represent the uninformed search of Breadth-first search and depth
uninformed search algorithms. first search. Therefore, on average, best first search
To illustrate the efficiency, we calculate the requires only 5.33% memory and 4.45% of computational
percentage of raised and explored nodes in the informed power required by uninformed search.
Table 3: Comparison of the average number of raised and explored nodes among different algorithms
Average number of Average number Average ratio of
Search algorithm raised nodes of explored nodes explored to raised nodes
Breadth-first search 196.57 70.87 0.368
Depth first search 328.87 294.63 0.748
Optimal search 196.57 70.87 0.368
Best first search (Mismatched tile) 12.10 4.73 0.399
Best first search (Manhattan distance) 14.10 5.43 0.396
Table 4: The average percentage of raised nodes in Best First Search using mismatched tile heuristic compared to uninformed search
Best first search (mismatched The average percentage The average percentage
tile) compared to of raised nodes of explored nodes
Breadth first search 6.16% 6.68%
Depth first search 3.68% 1.61%
Table 5: The average percentage of raised nodes in best first search using Manhattan distance heuristic compared to uninformed search
Best first search (Manhattan The average percentage The average percentage
tile) compared to of raised nodes of explored nodes
Breadth first search 7.17% 7.67%
Depth first Search 4.29% 1.84%
1154
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
1155
Wahyu Hidayat et al. / Journal of Computer Science 2021, 17 (11): 1147.1156
DOI: 10.3844/jcssp.2021.1147.1156
Iordan, A. E. (2018). A comparative study of the A* Pathak, M. L., Patel, R. L., & Rami, S. P. (2018).
heuristic search algorithm used to solve efficiently a Comparative Analysis of Search Algorithms.
puzzle game. In IOP Conference Series: Materials International Journal of Computer Applications,
Science and Engineering (Vol. 294, No. 1, p. 179(50), 40-43. doi.org/10.5120/ijca2018917358
012049). IOP Publishing.
Rahim, R., Abdullah, D., Simarmata, J., Pranolo, A., Ahmar,
doi.org/10.1088/1757-899X/294/1/012049
A. S., Hidayat, R., ... & Zamzami, Z. (2018a). Block
Iordan, A. E. (2019). Comparative Analysis of Four
Heuristic Functions that Optimizes the A* Search Architecture Problem with Depth First Search Solution
Algorithm. doi.org/10.9734/bpi/amacs/v2 and Its Application. In Journal of Physics: Conference
Iordan, A. E. (2016). A Comparative Study of Three Series (Vol. 954, No. 1, p. 012006). IOP Publishing.
Heuristic Functions Used to Solve the 8-Puzzle. doi.org/10.1088/1742-6596/954/1/012006
British Journal of Mathematics & Computer Science, Rahim, R., Kurniasih, N., Hasibuan, A. andriany, L.,
16(1), 1-18. doi.org/10.9734/bjmcs/2016/24467 Najmurrokhman, A., Supriyanto, S., ... & Abdullah,
Ismail, I. M., & Agwu, N. N. (2019, February 4). D. (2018b). Congklak, a traditional game solution
Influence of heuristic functions on real-time heuristic approach with breadth first search. In MATEC Web
search methods. 14th International Conference on of Conferences (Vol. 197, p. 03007). EDP Sciences.
Electronics Computer and Computation, ICECCO doi.org/10.1051/matecconf/201819703007
2018. doi.org/10.1109/ICECCO.2018.8634782
Russell, S., & Norvig, P. (2020). Artificial Intelligence:
Kumar, R., Jamal Ansari, M. T., Baz, A., Alhakami, H.,
Agrawal, A., & Khan, R. A. (2021). A multi-perspective A Modern Approach (4th ed.). Prentice Hall.
benchmarking framework for estimating usable- Sahu, K., Alzahrani, F. A., Srivastava, R. K., & Kumar, R.
security of hospital management system software (2020). Hesitant fuzzy sets based symmetrical model of
based on fuzzy logic, ANP and TOPSIS methods. decision-making for estimating the durability of Web
KSII Transactions on Internet and Information application. Symmetry, 12(11), 1770.
Systems, 15(1), 240–263. doi.org/10.3390/SYM12111770
doi.org/10.3837/TIIS.2021.01.014 Sahu, K., Alzahrani, F. A., Srivastava, R. K., & Kumar,
Lu, Y. (2019). Artificial intelligence: A survey on R. (2021). Evaluating the Impact of Prediction
evolution, models, applications and future trends. Techniques: Software Reliability Perspective.
Journal of Management Analytics, 6(1), 1-29. CMC-Computers Materials & Continua, 67(2),
doi.org/10.1080/23270012.2019.1570365
1471-1488. doi.org/10.32604/cmc.2021.014868
Meister, C. (2020). Best-First Beam Search. Transactions
Zafar, A., Agrawal, K. K., & Kumar, W. C. A. (2018).
of the Association for Computational Linguistics, 8,
795–809. doi.org/10.1162/tacl a 00346 Analysis of multiple shortest path finding
Menon, V., & Amali, G. B. (2018). Performance Analysis algorithm in novel gaming scenario. In Intelligent
of Various Uninformed and Informed Search Communication, Control and Devices (pp.
Strategies on 8 Puzzle Problems - A Case Study. 1267-1274). Springer, Singapore.
World Wide Journal of Multidisciplinary Research doi.org/10.1007/978-981-10-5903-2_132
and Development, 4(12), 96–99. Zhang, W., Sauppe, J. J., & Jacobson, S. H. (2021).
Navya, P., & Ranjith, R. (2021). Performance Analysis of Comparison of the number of nodes explored by
BFS and DFS Algorithms for Food Serving Robot in cyclic best first search with depth contour and best
an Eatery Performance Analysis of BFS and DFS first search. Computers & Operations Research, 126,
Algorithms for Food Serving Robot in an Eatery. 105-129. doi.org/10.1016/j.cor.2020.105129
EasyChair Preprints, 5638.
https://easychair.org/publications/preprint/zVBw
1156