Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's restrict ourselves to the simplest case first: Find a suitable data structure that allows for a fast implementation of <strong>FirstFreeSlot()</strong>.</p> <p>The free time slots live in a two-dimensional space: One dimension is the start time s, the other is the length d. <strong>FirstFreeSlot(D)</strong> effectively answers the following query:</p> <p>min s: d >= D</p> <p>If we think of s and d as a cartesian space (d=x, s=y), this means finding the lowest point in a subplane bounded by a vertical line. A <a href="http://en.wikipedia.org/wiki/Quadtree" rel="nofollow">quad-tree</a>, perhaps with some auxiliary information in each node (namely, min s over all leafs), will help answering this query efficiently.</p> <p>For <strong>Enqueue()</strong> in the face of resource constraints, consider maintaining a separate quad-tree for each resource. The quad tree can also answer queries like</p> <p>min s: s >= S &amp; d >= D</p> <p>(required for restricting the start data) in a similar fashion: Now a rectangle (open at the top left) is cut off, and we look for min s in that rectangle.</p> <p><strong>Put()</strong> and <strong>Delete()</strong> are simple update operations for the quad-tree.</p> <p><strong>Recalculate()</strong> can be implemented by <strong>Delete()</strong> + <strong>Put()</strong>. In order to save time for unnecessary operations, define sufficient (or, ideally, sufficient + necessary) conditions for triggering a recalculation. The <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow">Observer</a> pattern might help here, but remember putting the tasks for rescheduling into a FIFO queue or a priority queue sorted by start time. (You want to finish rescheduling the current task before taking over to the next.)</p> <p>On a more general note, I'm sure you are aware that most kind of scheduling problems, especially those with resource constraints, are NP-complete at least. So don't expect an algorithm with a decent runtime in the general case.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload