# Optimization of Intelligent Maintenance System in Smart Factory Using State Space Search Algorithm
### Literature Review on Available Solutions
#### 1.1.3 State Space Search Algorithms
Heuristic: A heuristic h is defined as follows:  
h(x) = Estimate of the distance of node x from the goal node. The lower the value of h(x), the closer the node is to the goal. Strategy:  
* The algorithm starts at the starting node and evaluates nearby nodes. * The algorithm chooses the neighbor with the lowest heuristic value and proceeds. * Greedy breadth-first searches do not guarantee finding the best route, as they can get stuck on the most suitable route in the area. They always choose the path that looks best at the moment. 2. A* Search:  
A* search is one of the most widely utilized reference search algorithms [20; 21]. It combines the advantages of uninformed cost search and greedy breadth-first search by employing a mixed cost function:  
\[\text{f(n)}=\text{g(n)}+\text{h(n)} \tag{16}\]  
where  
g(n) is the exact cost from the start node to node n;  
h(n) is the heuristic estimate of the cost from n to the goal. Heuristic: The following points should be noted with heuristics in the A* search. \[\text{for h(n')}+\text{k(n,n')}\geq\text{h(n)} \tag{10}\]0  
Here,  
h(x) is referred to as the forward cost and is an estimate of the distance of the current node from the goal node. g(x) is referred to as the backward cost and is the cumulative cost of a node from the root node. A* search is considered optimal only when, for all nodes, the heuristic cost h(x) underestimates the actual cost h*(x) to reach the goal. This property of the A* heuristic is referred to as admissibility. Admissibility:  
\[\text{for h(n')}+\text{k(n,n')}\geq\text{h(n)} \tag{10}\]1  
Strategy:* A* search evaluates nodes based on the sum of route costs and heuristic estimates. * The algorithm will guarantee that the path it finds is both the shortest and the most cost-effective. * The heuristic function must be able to be used (the actual cost will not be exaggerated). Each algorithm has its strengths and weaknesses, making it suitable for different types of problems. Informed search strategies are designed to reduce the computational effort required to find a solution by making informed decisions about which nodes to expand. These strategies rely on heuristic functions to evaluate the desirability of expanding a particular node. The A* search algorithm is a prominent example of an informed search strategy that utilizes a heuristic function to guide its search process. A heuristic function, denoted as (h(n)), provides an estimate of the cost to reach the goal from a given node (n). The effectiveness of the heuristic function is crucial, as it influences the efficiency of the search. An ideal heuristic function closely approximates the actual cost, thereby enabling the algorithm to make more informed decisions about node expansion [22]. This research aims to compare the A* Search algorithm with the traditional periodic maintenance methods currently employed by an electrical wire manufacturing company in Thailand. The process of determining the lowest path cost for maintenance will utilize the A* Search algorithm, which will subsequently be integrated with Failure Modes and Effects Analysis (FMEA) for the next phase. The A* search algorithm combines the actual cost to reach a node (n) from the start node, denoted as (g(n)), with the heuristic estimate (h(n)) to form a total cost function (f(n)) [C_4]. \[\text{for h(n')}+\text{k(n,n')}\geq\text{h(n)} \tag{10}\]2  
The algorithm proceeds as follows:  
1. Initialization: The algorithm begins with the initial node, which is added to the open list (a list of nodes to be evaluated). The cost functions are initialized such that (g(n) = 0) and (f(n) = h(n)). 2. Node Selection: The node with the lowest (f(n)) value is selected from the open list. 3. Goal Check: If the selected node is the goal node, the search terminates successfully. 4. Successor Generation: The selected node is expanded, and its successor nodes are generated. 5. Successor Evaluation: For each successor, the values of (g(n)) and (f(n)) are computed.