Best Path in Mountain Environment based on Parallel Hill Climbing Algorithm

Heuristic search is a search process that uses domain knowledge in heuristic rules or procedures to direct the progress of a search algorithm. Hill climbing is a heuristic search technique for solving certain mathematical optimization problems in the field of artificial intelligence. In this technique, starting with a suboptimal solution is compared to starting from the base of the hill, and improving the solution is compared to walking up the hill. The optimal solution of the hill climbing technique can be achieved in polynomial time and is an NPcomplete problem in which the numbers of local maxima can lead to an exponential increase in computational time. To address these problems, the proposed hill climbing algorithm based on the local optimal solution is applied to the message passing interface, which is a library of routines that can be used to create parallel programs by using commonly available operating system services to create parallel processes and exchange information among these processes. Experimental results show that parallel hill climbing outperforms sequential methods. Keywords—Hill climbing; heuristic search; parallel processing; Message Passing Interface (MPI)


I. INTRODUCTION
Hill climbing algorithm based on the local optimal solution was proposed and applied to the Message Passing Interface (MPI), which is a library of routines that can be used to create parallel programs in C, C++, and Fortran 77 by using commonly available operating system services to create parallel processes and exchange information among these processes [1]. In this algorithm, the 10 closest points around the current point are scanned, and the cost needed to go from the current point to the next point is obtained by calculating the sum of the obstacles between the current point and the 10 other points. The MPI method is used to validate the performance of the hill climbing algorithm by using parallel and distributed computing systems compared with sequential methods [2].
Hill climbing is a heuristic search technique for solving certain mathematical optimization problems in the field of artificial intelligence [3]. In this technique, starting with a suboptimal solution is compared to starting from the base of the hill, and improving the solution is compared to walking up the hill. The solution is improved repeatedly until a certain condition is maximized and becomes optimal. This technique is mainly used to solve difficult problems computationally [4].
Heuristic search is an artificial intelligence search technique and a computer simulation of thinking that utilizes heuristic for its moves [5,6]. Heuristic search is a search process that uses domain knowledge in heuristic rules or procedures to direct the progress of a search algorithm, is utilized to prune the search space, and is adopted in applications where a combinatorial explosion indicates that an exhaustive search is impossible [7].
The objective of heuristic search is to produce a solution in a reasonable time frame that is sufficient to solve the problem at hand. This solution may not be the best of all the solutions to this problem, or it may simply approximate the exact solution, but it is still valuable because finding it does not require a prohibitively long time. For large and complex problems, finding an optimal solution path can take a long time and a suboptimal solution that can be obtained rapidly may be useful. Various techniques for modifying a heuristic search algorithm, such as hill climbing, to allow a tradeoff between solution quality and search time have been investigated [8,9].
The optimal solution of Hill Climbing technique can be achieved in polynomial time and it is one of the NP-Complete problem that the numbers of local maxima can be the cause of exponential computational time. To address these problems parallel and distributed computing systems can be applied to Hill Climbing algorithm. Parallel and distributed computing systems are high-performance computing systems that spread out a single application over many multi-core and multiprocessor computers in order to rapidly complete the task. Parallel and distributed computing systems divide large problems into smaller sub-problems and assign each of them to different processors in a typically distributed system running concurrently in parallel. MPI are one these computing systems [10,11].
The MPI is a standardized means of exchanging messages among multiple computers running a parallel program across a distributed memory. The MPI is generally considered to be the industry standard and forms the basis for most communication interfaces adopted by parallel computing programmers. The MPI is used to improve scalability, performance, multi-core and cluster support, and interoperation with other applications [12]. www.ijacsa.thesai.org The rest of the paper is organized as follows. Section II reviews works that are closely related to the hill climbing algorithm. Sections III and IV present the methodology of the new proposed algorithm and its analysis. Section V presents the experimental results. Section VI provides the conclusion.

II. RELATED WORK
Mathematicians and research scientists have found many applications that use heuristic search. The increased use of heuristic search in a wide variety of applications, such as science, engineering, economics, and technology, is due to the advent of personal and large-scale computers.
Rashid and Tao [13] presented an optimized hill climbing algorithm called parallel iterated local search with efficiently accelerated GPUs. They also tested the algorithm by using a typical case study of the graph bisection in computational science. The proposed algorithm minimizes the data transfer between two components to achieve the best performance. Then, the purpose of the parallelism control is to control the generation of the neighborhood for meeting the memory constraints and finding efficient mappings between neighborhood candidate solutions and GPU threads. The authors found through experiments that GPU computing not only accelerates the search process but also exploits parallelism to improve the quality of the obtained solutions for combinatorial optimization problem.
Jiang et al. [14] proposed an optimal power allocation (OPA) method to exert the maximum efficiency of parallel grid-connected inverters. They established the power model of every inverter and compared each model by using the equal power allocation (EPA) method. Theoretically, high overall system efficiency can be achieved using the OPA method. Then, the authors calculated the overall system efficiency with easily measurable electric parameters and realized online optimization by adopting an existing method, such as the hill climbing method. They tested the effectiveness of the proposed method by comparing it with the equivalent power allocation method. They found that the overall system efficiency of the OPA method is higher than that of the EPA method. Moreover, the system using the hill climbing method performs effectively in the dynamic process with short response time.
Kim et al. [15] performed component sizing of power sources of parallel hybrid vehicle by applying the golden section search and hill climbing algorithms. The golden section search algorithm was used in selecting a reduction gear ratio that connects the transmission to the electric motor by using the hill climbing search algorithm to find the optimal engine and electric motor sizes. The use of the hill climbing search algorithm reduces the number of simulations and simultaneously optimizes the capacity of the power source and the gear ratio of the torque coupler. The authors verified the validity of the component sizing results by comparing the global optimal solution obtained by the conventional technique with the solution obtained by the proposed optimization technique.
Robinson et al. [16] presented an improved algorithm for approximating the TSP on fully connected, symmetric graphs by utilizing the GPU. They improved an existing 2-opt hill climbing algorithm with random restarts by considering multiple updates to the current path found in parallel. Their approach has a k-swap function, which allows k number of updates per iteration. The authors showed that their modifications result in a substantial speedup without a reduction in the quality of the result by applying the k-swap method. Their experimental results showed that common assumptions in obtaining good performance for the GPU are not always true, such as saturating the GPU with blocks. Instead, for problems in which the search space can be deterministically enumerated, the number of active blocks can be limited as determined by the hardware. This property allows for reduced memory allocation. A limited amount of memory can be used because each block can allocate the amount of memory upfront.
Chen et al. [17] proposed an automatic machine learning (AutoML) modeling architecture called Autostacker, which is a machine learning system with an innovative architecture for automatic modeling and a well-behaved efficient search algorithm. Autostacker improves the prediction accuracy of machine learning baselines by utilizing an innovative hierarchical stacking architecture and an efficient parameter search algorithm. Neither prior domain knowledge about the data nor feature preprocessing is needed. The authors reduced the time of AutoML by using a naturally inspired algorithm called PHC. They demonstrated the operation and performance of their system by comparing it with human initial trails and related state-of-the-art techniques. They also confirmed the scaling and parallelization ability of their system. The authors also automated the machine learning modeling process by providing an efficient, flexible, and well-behaved system. This system can be generalized into complicated problems and integrated with data and feature processing modules.

III. METHODOLOGY
Hill climbing is a heuristic search technique for solving certain mathematical optimization problems in the field of artificial intelligence [18]. In this technique, starting with a suboptimal solution is compared to starting from the base of the hill, and improving the solution is compared to walking up the hill; the solution is improved repeatedly until some condition is maximized and becomes optimal, as illustrated in Fig. 1. This technique is mainly used for solving difficult problems computationally. It focuses on the current and immediate future states and does not maintain a search tree, thereby making it memory efficient [19]. Hill climbing technique can be used to solve many problems, such as network flow, traveling salesman, and 8-Queens, in which the current state allows for an accurate evaluation function [20]. This technique does not suffer from space-related issues because it focuses on the current state in which previously explored paths are not stored; nonetheless, an optimal solution can be achieved in polynomial time. However, for NP-complete problems, computational time can be exponential based on the number of local maxima [21].
Hill climbing technique comprises several phases, which start by constructing a suboptimal solution considering the constraints of the problem, followed by improving the solution by step and enhancing the solution until no more improvement is possible [22]. This technique is performed following the steps below. e) If the newer state is closer to the goal than the current state, then update the current state.
In the hill climbing algorithm, achieving the goal is equivalent to reaching the top of the hill.
In this research, a new hill climbing algorithm is proposed on the basis of local optimal solution. In this algorithm, the closest 10 points around the current point are scanned, and the cost needed to go from the current point to the next point is obtained by calculating the sum of the obstacles between the current point and the 10 other points. In this proposed algorithm we have designed the optimization technique as explained in the following equation: Where Ws is the weight of the slop, S is the slop of the point, Sg is the weight of the gravity, G is the gravity at that point, Wo is the weight of the obstacles, O is the value of the obstacles.
These values will be counted for each path from right and from left. Then, the path which has the lowest cost will be selected.
The scanning approach is performed as follows: In Table I, the current point is in red (23); each cell has a weight represented by a number. The scanning area is five paths to the right and five paths to the left.
Paths from left: Paths from Right: Thereafter, we decide which path should be taken depending on the minimum value among the total obstacle weights in each path. In the example above, the best path is number 1 because it has the minimum total value. Fig. 2 illustrates the Proposed Sequential Algorithm.
The above pseudocode is for sequential execution. To parallelize this algorithm, we must follow the following approach: 1) There will be a master node that will generate the matrix.
2) The master node must fill the matrix with the obstacle's weights based on the following equation so that the algorithm can calculate the cost.
Ws is the weight of the slop, S is the slop of the point, Sg is the weight of the gravity, G is the gravity at that point, Wo is the weight of the obstacles, O is the value of the obstacles.
1) The master node will broadcast the matrix to all other nodes so they can work in parallel.
2) Each node will calculate its start region from bottom and its end region from top as shown in Fig. 3.
3) All the node will start working at the same time. 4) After they all finish, each node will send the best path for the master node. 5) Finally, the master node will decide which path is the best path based on what did it get from the other nodes.  (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 9, 2020 111 | P a g e www.ijacsa.thesai.org For example, after broadcasting the matrix to all node, each processor will choose start region and end region depending on its ID. Thus, we will divide the very last row between the processor based on the following equations to get the start region for each processor: To get the end region for each processor, we will divide the very first row in the matrix between the processors based on the following equations: In the proposed system we have considered three approaches for finding the best path.
Approach #1: From All points below to unknown point above. In this approach the algorithm will start from each point below the hill and try to find a path depending on the discussed algorithm above, but the destination is not specified. So, the algorithm will suggest the path and will determine the destination point. To parallelize this approach each processor will start from the points in its region only.
Approach #2: From All points below to a specific point above. In this approach the algorithm will start from each point below the hill and try to find a path to a specific point above. To parallelize this approach each processor will start from the points in its region only.
Approach #3: From One point below to all points above. In this approach the algorithm will start from a specific point below the hill and try to find a path to all point above the hill. To parallelize this approach each processor will start from the specified point then it will use the End region to determine its destination based on the end region points only.
The evaluation of Hill Climbing technique used only at the current state, it does not suffer from computational space issues, where the source of its computational complexity arises from the time required to explore the problem space. The optimal solution of Hill Climbing technique can be achieved in polynomial time and it is one of the NP-Complete problem that the numbers of local maxima can be the cause of exponential computational time [23]. To address these problems proposed algorithm are applied on message passing interface (MPI) parallel and distributed computing systems with highperformance computing that spread out a single application over many multi-core and multi-processor computers to rapidly complete the task. MPI divide large problems into smaller sub-problems and assign each of them to different processors in a typically distributed system running concurrently in parallel.
In this research, Proposed Hill Climbing techniques are tested on two methods. First method is sequential that accessed code by a single thread. This means that a single thread can only do code in a specific order, hence it being sequential. Second method is MPI that is a library of routines that can be used to create parallel programs in C, C++, and Fortran77 using commonly available operating system services to create parallel processes and exchange information among these processes, as shown in Fig. 4.
The design process of MPI includes vendors (such as IBM, Intel, TMC, Cray, and Convex), parallel library authors (involved in the development of PVM, and Linda), and application specialists. The final version for the draft standard became available in May of 1994 [8].
MPI is a standardized means of exchanging messages among multiple computers running a parallel program across a distributed memory to improve scalability, performance, multicore and cluster support, and interoperation with other applications. These programs cannot use any MPI communication routine. The two basic routines are MPI_Send, to send a message to another process, and MPI_Recv, to receive a message from another process.  Proposed algorithm run MPI code in IMAN1, Jordan's first and fastest high-performance Computing resource, funded by JAEC and SESAME. It is available for use by academia and industry in Jordan and the region. In our project, we worked in a Zaina server, an Intel Xeon-based computing cluster with 1G Ethernet interconnection as shown in Table II. The cluster is mainly used for code development, code porting, and synchrotron radiation application purposes. In addition, this cluster is composed of two Dell PowerEdge R710 and five HP ProLiant DL140 G3 servers.  First; sequential analysis for best paths and parallel analysis for best paths indicate that the proposed algorithm is cost optimal based on the following equation: Second; sequential analysis for all to one or one to all and parallel analysis for all to one or one to all indicate that the proposed algorithm is cost optimal based on the following equation.

V. EXPERIMENTS AND RESULTS
This research uses different matrix sizes that contain points that need to go from the current point to the next point in a certain matrix. The cost of moving from the current point to the next point is calculated using the sum of the obstacles between the current point and all the 10 other points. The path is decided depending on the minimum value among the total obstacle weights in each path. The proposed algorithm is tested in sequential and parallel forms coded by MPI. The results are compared in terms of efficiency and speedup ratio.
First, simple hill climbing is used to calculate the time needed to find all the best paths from a specific point to another point with the least cost from that start point. Second, the proposed hill climbing algorithm is utilized to calculate the time required to find the best path from all the points below the www.ijacsa.thesai.org matrix to a specific point above the matrix. Finally, the proposed hill climbing algorithm is adopted to calculate the time needed to find the best path from a specific point below the matrix to all the points above the matrix.
The sequential results of the proposed hill climbing algorithm are tested with various matrix sizes. The algorithm is written in C++. The experimental results are calculated with the 1 core in MPI as shown in Table III.
The MPI results of the proposed hill climbing algorithm are tested using different numbers of cores and matrices. The results are effective and efficient when the number of cores is increased due to the large size of problems that need a high degree of parallelism. Table IV and Fig. 5 show the results for all the best paths. Fig. 6 illustrates all points below a point above, and Fig. 7 presents a point below all points above.
The comparison between MPI results and sequential methods indicates that MPI is always faster and more efficient than sequential methods for different matrix sizes. Table V presents the calculation results for speedup ratio. Fig. 8 shows the comparison of speedup ratio for all best path results. Fig. 9 reveals the speedup ratio for a point below to all points above. Fig. 10 illustrates the speedup ratio for all points below to a point above.   Table VI shows the calculation results for parallel efficiency. Fig. 11 presents the comparison of parallel efficiency for all best path results. Fig. 12 reveals the parallel efficiency for all points below to unknown point above. Fig. 13 illustrates the parallel efficiency for a point below to all points above.

VI. CONCLUSION
Heuristic search is a search process that uses domain knowledge in heuristic rules or procedures to direct the progress of a search algorithm. Hill climbing is a heuristic search technique for solving certain mathematical optimization problems in the field of artificial intelligence. In this technique, starting with a suboptimal solution is compared to starting from the base of the hill, and improving the solution is compared to walking up the hill. The optimal solution of the hill climbing technique can be achieved in polynomial time and is an NPcomplete problem in which the numbers of local maxima can lead to an exponential increase in computational time. To address these problems, the proposed hill climbing algorithm based on the local optimal solution is applied to the message passing interface, which is a library of routines that can be used to create parallel programs by using commonly available operating system services to create parallel processes and exchange information among these processes. Experimental results show that parallel hill climbing outperforms sequential methods.
This research uses different matrix sizes that contain points that need to go from the current point to the next point in a certain matrix. The cost of moving from the current point to the next point is calculated using the sum of the obstacles between the current point and all the 10 other points. The path is decided depending on the minimum value among the total obstacle weights in each path. The proposed algorithm is tested in sequential and parallel forms coded by MPI. The results are compared in terms of efficiency and speedup ratio.