Function to calculate the criterias for each solution