TADM2E 1.6

From Algorithm Wiki
Revision as of 22:41, 27 May 2019 by Kev (talk | contribs)
Jump to: navigation, search

Let $ U=\{1,2,3\} $ and S consists of $ S_1=\{1,2,8,4,10\} $, $ S_2=\{1,3,6,9\} $, $ S_3=\{1,2,3\} $. The algorithm would give an answer of $ S_1 $, $ S_2 $ but the correct answer is $ S_3 $ because it has the fewest elements and covers $ U $.

The algorithm would remove elements $ \{1,2\} $ (members of $ S_1 $ is the largest subset in $ S $. Then chose $ S_2 $ because it is the next largest and remove element $ \{3\} $. The algorithm would exit because $ U $ is empty. However, $ S_3 $ is the correct answer.