How is such a task?

0 like 0 dislike
More than sure that such a problem exists, perhaps even in summary form. Please tell me what it's called.
The task is:
You need to make a program of watching TV.
Each show has the following fields:
start time, end time, room, priority.
You need to in each moment, looked the most priority telecast.
by | 12 views

3 Answers

0 like 0 dislike
You should read about the problems the scheduling theory.
0 like 0 dislike
If we assume that any transfer can only look as a whole — it will be the task of the applications (=activity-selection problem).
Solved by a greedy algorithm like this. Presume the priority of transmission and solves the classical problem about the orders: take the one that ends early, then one that ends early, and does not contradict available In the "window" with the same algorithm put less of a priority, etc.

If you believe that you can throw a used transmission. Upon the occurrence of a higher priority transfer switch to it.
0 like 0 dislike
Don't know what the name of this task.

Solved sorting time of events and their enumeration: in each moment we must decide to "stay / switch".

There is a priority of the current transfer (if it is not the end). And there are priorities other gear at this point (especially interested in the beginning).

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
3 answers
0 like 0 dislike
5 answers
asked Apr 13, 2019 by NIKOOV
110,608 questions
257,186 answers
33,949 users