infinite cost in case of no path to task