# Formulating a combinatorial optimisation problem

I have a discrete optimisation problem. I suspect the answer will be use some kind of combinatorial optimisation approach, but I don't have significant enough experience to determine this.

My problem is as follows:

1. For a given day I have 48 half hour periods for which I can sell a service, $s_n$, to a counterparty (where there are $n$ different services).

2. There are several different types of service, $s_n$, each service comprising a set of time periods that the service is active.

• So for example, $s_1$ is offered between the hours of 1am and 7am, then 5pm and 9pm; a total of 10 hours
• $s_2$ is offered between the hours of 1am and 7am only; a total of 6 hours
• $s_3$ is offered between the hours of 6pm and 9pm; a total of 3 hours.

It is not possible to part schedule a service. So for example, it is not possible to offer $s_1$ for the hours of 1am to 5am only.

1. Having delivered the service at the required periods, each $s_n$ has a specific commercial profit associated with it, with some services being more valuable then others. So in the above example, if $s_1$ has a value of 4, $s_2$ value 3, $s_3$ value 3, then the most profitable combination of services is $s_2$ and $s_3$.

2. There is a hard constraint in that during each period, $p$, only one service can be provided to the counterparty.

• So it's not possible to have two services concurrently between 7pm and 9pm, for example. Or for one service to run from 7pm to 9pm and another to run from 7pm to 7.30pm, concurrently.

Given a set of $s_n$ possible services, what subset maximises the total profit between the periods of 1 to 48?

I have two questions: firstly, how should I approach the formulation of this in a formal way? I have read this https://en.wikipedia.org/wiki/Optimization_problem and it's still to abstract to help me articulate the problem so that I can usefully solve it.

Secondly, any pointers as to what optimisation techniques are the best to solve this problem, would be greatly appreciated

• You say there are half hour periods, so if only one service can be actively offered to the counterparty, why can a service block out others between 7pm-9pm and not just 7-7.30pm? – LinAlg Oct 12 '16 at 15:52
• That's a valid point. I will edit my original post. Thank you – Anthony W Oct 12 '16 at 16:56
• Ok, I've updated the question as you suggested. Hopefully that's clearer. A service earns equal amounts in each period. Once delivery starts, it cannot be stopped half way; it's all or nothing. – Anthony W Oct 13 '16 at 13:29
• A service can be offered for all 48 periods or any variation thereafter. Each service is typically offering something different, so 3 hours of one service in the afternoon might be significantly more valuable than six hours of a different service in the morning. – Anthony W Oct 13 '16 at 13:39
• The half hour periods are not relevant at all, are they? – LinAlg Oct 13 '16 at 13:58

Take $s_{ik}$ to be the binary variable taking value $1$ if $i^{th}$ service is offered in the period $k$. So if the service $i$ can not be offered during a certain period this should take value $0$. Since only one service can be provided during any period $k$ therefore $$s_{ik} \leq 1 - s_{jk} \hspace{1cm} \forall \hspace{0.2cm} j \neq i$$ Next to ensure that, as in example above, if the service $s_{1}$ is being offered then it has to be offered continuously during the period 1 AM to 7 PM you can have all variables $s_{1k}$ equal for $1 AM < k < 7 PM$. Similarly for other services.
Put the services $s_n^k$ vertically and the 48 time periods horizontally (and extra dummy columns to make the system square). Each cell has the profit in it, or $0$ if the permutation not offered at a specific time. If you solve it, every service $s_n^k$ is either assigned to one of 48 time periods, or to a dummy time period (which means it is not offered).
• Every job (worker) will be assigned to at most one time slot (job). When you talk about "a sequence", do you mean that $s_n^2$ cannot be delivered before $s_n^1$? If the answer is "no", my solution is the correct one. – LinAlg Oct 13 '16 at 11:49