https://123dok.net/document/qo5rvv5y-using-hard-constraints-for-representing-soft-constraints.html