In: Computer Science
a.)
Hard constraints | Soft constraints |
---|---|
Absolutely non-negotiable | Negotiable if necessary |
Always respected by the scheduler | Usually respected by the scheduler |
Exceptions are never made | Exceptions are made if it's the difference between generating a schedule and not generating one |
Usually make the scheduler run slower | No impact on scheduler speed |
Decrease likelihood that the scheduler will find any schedules | Likelihood of finding schedules not affected |
Too many hard constraints may mean not getting any schedules | No penalty for having lots and lots of soft constraints |
b.) Task that can be solved using constraints :- consider the Sudoku problem again. Suppose that a row, column and block already have 3, 5 and 7 filled in. Then the domain for all the variables in that row, column and block will be {1, 2, 4, 6, 8, 9}.
Flow chart of Constraint based programming solving process.