__author__ = ‘jayha_000’
from csp import CSP
canterbury_colouring = CSP(
var_domains={
‘christchurch’: [‘red’, ‘green’],
‘selwyn’: [‘red’, ‘green’],
‘waimakariri’: [‘red’, ‘green’],
},
constraints={
lambda christchurch, waimakariri: christchurch != waimakariri,
lambda christchurch, selwyn: christchurch != selwyn,
lambda selwyn, waimakariri: selwyn != waimakariri,
})