RecallWeave / algorithm studioWorks offline

Dynamic programming · weighted intervals

Some choices fit.
Which fit best?

Give each activity a time window and a value. Compare taking it with leaving it out, then follow the table back to one best schedule.

One resource. Fixed times. Additive values.

  1. Choose compatible activities.
  2. Compare two smaller problems.
  3. Reconstruct the choices.

01 / set up

Your activities

Up to eight activities. Times 0–24, values 0–99, all whole numbers.

Loading an example replaces the activity fields.

Touching is allowed. An activity ending at 4 can be followed by one starting at 4. The notation is [start, end). These are abstract time units.

02 / compare

Read the table

Finish order, then start, then ID. Row 0 is the empty prefix.

Best value · empty prefix0

No activities considered yet.

Selected in this prefixNone

An empty schedule is allowed.

Row 0

Two alternatives for each row

OPT(j) = max(value(j) + OPT(p(j)), OPT(j − 1))

RowActivityp(j)TakeSkipOPT(j)Decision

p(j) is the last compatible earlier row, or 0. Equal take and skip values keep the skip alternative. Choose a row to inspect that prefix.

Keep learning

Twelve questions. Worked explanations.

Bring the original lesson into RecallWeave. Answer in your own order of discovery, review the explanations, retry missed connections and keep your study notes.

In the learner, choose the downloaded file under “Bring your own lesson”, review its preview, then select “Start this deck”. The links above use the project folder; the downloads work when this page is copied by itself.

Change one thing, then explain it.

  • In the first example, lower D's value from 10 to 7. Which full schedule wins now?
  • Load “Touching endpoints”. Move B's start from 2 to 1. Which compatibility link disappears?
  • Give every activity value 0. Why can an empty schedule still be optimal?
Assumptions, tie rules and what the model leaves out

Activities have fixed start/end times, require one shared resource, and contribute independent nonnegative values. You can select any compatible subset, including none. There are no setup gaps, dependencies, multiple rooms or uncertain durations. The page maximizes the stated sum of values, rather than the number of activities or time occupied.

Rows are ordered by end, start and exact ID. When take and skip are equal, the current row is skipped. This returns one deterministic optimum; another schedule can have the same best value. The earliest-finish schedule is shown as a comparison heuristic for total value and may tie or fall short. The full algorithm uses sorting and predecessor search; this explorer caps inputs at eight activities to keep every step readable.

Everything runs in this page. Fields stay in tab memory and are not saved automatically. Downloads are explicit local files. This original teaching example does not establish learning efficacy or supply an external scheduling service.