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,
})
#Unchanged since for every option in every domain there is an option in the
#corresponding domain that does not equal it