Massive computations in today's computer applications necessitate the use of high-performance computing environments. Unfor-tunately, high costs and power management must be addressed while operating these environments. Volunteer computing (VC) enables the creation of a global network of computing devices capable of accumulating their computing power to outperform any supercomputer. VC refers to the use of underutilized computing resources donated by thousands of volunteers who want to actively participate in solving common research problems. However, VC systems experience unexpected and sudden loss of connections between volunteers' computing resources and the main server. In this case, the server must redistribute the work to new devices as they become available. This process is known as task migration, and it is already used in various volunteer frameworks to address the unavailability of computing resources. However, there is a tendency to limit the number of migrations since they are considered a technically complex and time-consuming process. In this paper, we employ heuristic search algorithms to reduce task migrations caused by loss of connections in Peer-to-Peer volunteer networks by locating an alternate network path to send output files to the server when the direct link is no longer available. The simulation results demonstrate that using a heuristic search algorithm eliminates all task migrations caused by loss of connections, resulting in less total execution time and power consumption.