Cost-Optimal Planning by Self-Interested Agents