Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2015/functional-programming-design-and-analysis-of-algorithms/6/c/solution

Three examples of independent sets are , and : none contains both endpoints of an edge. The maximum independent sets are
The triangle on contributes at most one vertex, and the path on contributes at most two, giving the upper bound three. Both displayed sets attain it. A three-element choice cannot use , since that excludes and leaves at most one of the adjacent vertices . Consequently it must use or , together with both ; these are the only two choices. In particular, the maximum independent set is not unique.
Highlighted vertices give the two possible optimal choices. The third side of the left triangle rules out choosing both and .

New to topics? Read the docs here!