The document defines an optimal algorithm as one that finds an optimal solution if one exists. For an algorithm to be optimal, the state space must satisfy two conditions: local finiteness and a lower bound on edge costs. Local finiteness means that from each node there are a finite number of possible next nodes. The lower bound on edge costs means that the cost of each edge is greater than some fixed value. The document proves that if these two conditions are met, the algorithm is guaranteed to find an optimal solution by showing it will terminate in a finite number of steps.