Calculating cost and feasibility