Below my #prolog solution for “Doctor Planning” proposed by dmcommunity.org challenge April 2020
There should be more constraints like a limit of shifts a week for each doctor… In any case after few seconds I get the first result [[2,3,4],[2,3,4],[2,3,4],[2,3,4],[1,2,3],[1,2,4],[1,2,4]]
It means: Monday sheets: doctor 2 (early), doctor 3 (late) and doctor 4 (night)…
:- use_module(library(clpfd)). /* using swi-prolog */ :- use_module(library(clpz)). /* using scryer-prolog */ /* solver for issue https://dmcommunity.