演算法›Ch7 貪婪演算法
第 5 題/共 12 題
◀ AL 5/12
5. Activity Selection、Greedy Algorithm
#AL-07-005中Activity SelectionGreedy Algorithm
  1. Activity-selection problem. Suppose we have a set S={a1,a2,…,an}S=\{a_1,a_2,\ldots,a_n\} of n proposed activities. Each activity aia_i has a start time sis_i and a finish time fif_i, where 0≤si<fi<∞0\le s_i < f_i < \infty. If selected, activity aia_i takes place during the half-open time interval [si,fi)[s_i,f_i). Activities aia_i and aja_j are compatible if the intervals [si,fi)[s_i,f_i) and [sj,fj)[s_j,f_j) do not overlap. That is, aia_i and aja_j are compatible if si≥fjs_i\ge f_j or sj≥fis_j\ge f_i. In the activity-selection problem, we wish to select a maximum-size subset of mutually compatible activities. For the following greedy ideas, select the one(s) that yield an optimal solution.
📄 交大110
跳轉到第題
▤完整推導請見《WH 資工筆記 · 演算法》Ch7 貪婪演算法
本章題號 · 1–12 / 12