                 }
 
                 // Create constraint solver and run backtracking algorithm
-                self.csp = ConstraintSolver(domains: domains, constraints: constraints, variables: eventFrames)
+                self.csp = ConstraintSolver(domains: domains, constraints: constraints, variables: eventFrames, backup: collisionGroups, width: self.width)
                 if !self.cancelFlag {
                     frames = self.csp?.backtrack()
                 }

    let date: DayDate
    // Width of the current day view cell.
    var width: CGFloat {
        return LayoutDefaults.dayViewCellWidth
    }
    // Height of the current day view cells.
    var height: CGFloat {
        return LayoutDefaults.dayViewCellHeight
    }
    // Delegate

    let constraints: [[Bool]]
    // Number of variables.
    let n: Int
    // Width of day
    let width: CGFloat
    // Backup collision groups
    let collisionGroups: [[[EventFrame]]]
    // Start time of the algorithm.
    let startTime: TimeInterval
    // Bool stores a cancellation flag.
    private var cancelled: Bool = false

    // Init with given domains, constraintsa and variables.
    init (domains: [Set<WidthPosValue>], constraints: [[Bool]], variables: [EventFrame], backup collisionGroups: [[[EventFrame]]], width: CGFloat) {
        self.variables = variables
        self.constraints = constraints
        self.domains = domains
        self.n = variables.count
        self.startTime = Date.timeIntervalSinceReferenceDate
        self.collisionGroups = collisionGroups
        self.width = width
    }

    // Trigger the backtrack algorithm and check if solution is valid.
