Trust propagation is being increasingly adopted to assist recommendation systems in providing more reliable information, upon which, users can make more accurate decisions. Optimal trust path search integrating trust value and path length plays a critical role in trust propagation, but suffers from insufficient performance regarding search accuracy and time. Generally, the quality of trust propagation is affected by the path length, and the longer the path is, the worse the trust quality is. However, the length of the path is not the unique crucial factor. Some longer paths with greater trust values may be more credible. In addition, the A* algorithm can find an optimal solution, but it expends much time to distinguish some similar paths. The A* algorithm is improved and a dynamic weighted heuristic trust path search algorithm is proposed. According to the six-degree space theory, the paths are extended to six-degree admissible trust paths. Then, according to the depths of the nodes in the search path, it relaxes the evaluation functionf(n) by devising a dynamic weighted factor w, inserts all nodes satisfied specific conditions into the FOCAL list. Furthermore, it sets the secondary heuristic factor and selects the nodes with the minimum heuristic factor value to reach the target node, and outputs the optimal trust path. Experiments on the public Advogato and FilmTrust datasets demonstrated that the proposed algorithm could efficiently identify the reliable trust paths and predict trust value with high accuracy and reduced computational complexity. The proposed algorithm could be applied to recommendation systems in the future.