encapsulate max cost fallback for sssp alignment