Part IV. OptaPlanner score calculation

Every @PlanningSolution class has a score. The score is an objective way to compare two solutions. The solution with the higher score is better. The solver aims to find the solution with the highest score out of all possible solutions. The best solution is the solution with the highest score the solver has encountered during solving, which might be the optimal solution.

OptaPlanner cannot automatically know which solution is best for your business, so you must tell it how to calculate the score of a specified @PlanningSolution instance according to your business requirements. If you forget or are unable to implement an important business constraint, the solution is probably useless, as illustrated in the following image:

Optimal solution with incomplete constraints