Model formulation for question 1
The representation of this classical project scheduling problem as a CP model is quite straightforward. We add a fictitious task with duration zero that corresponds to the end of the project. We thus consider the set of tasks TASKS = {1,...,N} where N is the fictitious end task. Let DURi be the duration of task i. The precedences between tasks are represented by a set of arcs, ARCS (an arc (i,j) ∈ ARCS symbolizes that task i precedes task j). The fictitious task follows all tasks that have no successor.
We define decision variables starti for the start time of every task i. These variables take values within the interval {0,...,HORIZON} where HORIZON is the upper bound on the total duration given by the sum of all task durations.
We obtain the following simple CP model:
∀(i,j) ∈ ARCS: starti + DURi ≤ startj