I was asked this question on an interview. Can someone give me some insight on how to do this? I was stumped
Often, greedy algorithms they are used as heuristics. An independent set in an undirected graph G is a set of nodes I so that no edge has both endpoints in I. In other words, if {u,v} included in set E, then either u not included in set I or v not included in set I. The maximum independent set problem is , given G, nd an independent set of the largest possible size.
Implement a greedy algorithm for maximum independent set based on including nodes of smallest degree.