# 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
The function h is referred to as the heuristic function, while the function f is known as the heuristic evaluation. If h does not overestimate the actual cost from node n to the target node, the heuristic estimate h consists of the following:  
f(n') \(\geq\) f(n), where n is the parent node and n' is the child node. \[\text{for h(n')}+\text{k(n,n')}\geq\text{h(n)} \tag{10}\]  
where k(n,n') is the cost edge from n to n'. \[\text{Given f(n')}\geq\text{f(n)},\text{ or g(n')}+\text{h(n')}\geq\text{g(n)} \tag{11}\]  
Using g(n) + k(n,n'), then:  
\[\text{g(n)}+\text{k(n,n')}+\text{h(n')}\geq\text{g(n)}+\text{h(n)},\text{ or k(n,n')}+\text{h(n')}\geq\text{h(n)} \tag{12}\]  
Algorithms for optimal solutions can be employed to determine the sequence of selecting the appropriate operations while considering costs. The cost function can be utilized to  
Figure 8: Template for depth-first search. aggregate the costs associated with the path derived from the original problem [21] to the current state and the estimated cost of the route from the current state to the target state. The simple cost function is defined as follows:  
\[\text{f(n)}=\text{g(n)}+\text{h(n)} \tag{13}\]  
where g(n) is the cost of the path from the initial state to the current node n, and h(n) is the estimated cost from node n to the target node, as shown in Figure 9a. The first algorithm we examine is the breadth-first search (BFS) algorithm. It maintains a partially expanded state space representation initially containing only the root node in each iteration. The breadth-first search algorithm extends the node with the minimum cost among all created nodes that have not yet been expanded, continuing this process until the most suitable target node is identified for expansion, as illustrated in Figure 9b. The algorithm is summarized in Table 1.  
Breadth-first search (BFS) is an algorithm designed for exploring or searching tree and graph data structures. It begins at the root node and examines all neighboring nodes at the current depth before progressing to the next level. S = the depth of the shallowest solution. n'I = number of nodes in level i  
_Time complexity:_ equivalent to the number of nodes traversed in DFS. \[\text{T}^{\text{*}}(\text{(n)})=1+\text{n}^{\text{*}}2+\text{n}^{\text{*}}3+ \cdots+\text{n}^{\text{*}}\text{s}=\text{O(n}^{\text{*}}\text{s}) \tag{14}\]  
_Space complexity:_ equivalent to how large the fringe can become. \[\text{S(n)}=\text{O(n}^{\text{*}}\text{s}) \tag{15}\]  
_Completeness:_ BFS is complete, meaning that for a given search tree, BFS will solve if it exists. _Optimality:_ BFS is optimal as long as the costs of all edges are equal. \begin{table}
\begin{tabular}{l} \hline \hline
**Breadth-First Search** \\ \hline _BFS(root)_ \\ _open_\(\ast\) _\(\ast\) _\(  
Informed Search Algorithms:  
Informed search algorithms outperform uninformed ones in terms of speed and optimality when solving common problems; these algorithms, often referred to as heuristic search algorithms, are a fundamental component of artificial intelligence. These algorithms leverage domain-specific knowledge to enhance the efficiency of the search process, resulting in faster and more appropriate solutions compared to uninformed search methods. Informed search algorithms can make educated predictions about which paths to explore within the search space, ultimately reducing the time and computational resources needed to find a solution. Examples of such algorithms include the greedy breadth-first search and A* search algorithms [20]. Search heuristics: In an informed search, the heuristic function assesses the proximity of a given state to the goal state. Different heuristics are employed in various informed search algorithms, as discussed below. 1. Greedy search:  
This is a heuristic-driven algorithm that prioritizes the exploration of nodes based on the estimated cost to reach the goal. The algorithm selects the most promising nodes according to the heuristic function, which evaluates the cost from each node to the goal, denoted by h(x).