Profile-Based Optimal Matchings in the Student-Project Allocation Problem