# Beginners question: how to formulate this assignment/scheduling problem?

**URL:** <https://discourse.julialang.org/t/beginners-question-how-to-formulate-this-assignment-scheduling-problem/39681>\
**Category:** Optimization (Mathematical)\
**Created:** [May 18, 2020, 8:06am UTC](https://discourse.julialang.org/t/beginners-question-how-to-formulate-this-assignment-scheduling-problem/39681 "2020-05-18T08:06:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 18, 2020, 1:18pm UTC](https://discourse.julialang.org/t/beginners-question-how-to-formulate-this-assignment-scheduling-problem/39681/2 "2020-05-18T13:18:36Z")

</div>

There is a stackexchange for more modeling type questions: [https://or.stackexchange.com](https://or.stackexchange.com)

You could, for example, add constraints like this which limit the ability to have back-to-back talks:

```nohighlight
for m in 2:(M - 1)
    @constraint(model, sum(x[(m - 1):(m + 1)]) <= 1)
end

```

Otherwise a common approach to this is to generate a bunch of columns in your matrix a priori, assign a binary variable for each column/speaker pair (indicating if the speaker has talks for the column) and then have constraints saying that the sum across the row has to be \<= 1 (at most one talk per slot) and that each speaker has to pick one column. Then your objective coefficients can measure how “regular” the talks in a particular column are. But a naive implementation can scale poorly as M gets large.

---

_[View the full topic](https://discourse.julialang.org/t/beginners-question-how-to-formulate-this-assignment-scheduling-problem/39681)._
