views:

154

answers:

1

Hi,

in words, can someone post directions towards finding the 'maximal' independent set in a simple graph?

I read up something from ETH site which said one can find such in O(n) by simply picking a random vertex v and than scanning the rest and attempting to find if there's an edge from v to the rest.

Thanks

+4  A: 

Yes, by definition, a maximal indpendent set is an independent set to which no more vertices can be added without violating the 'independence' condition.

So just picking vertices till you can pick no more would give you a maximal independent set, can be done in linear time (i.e. linear in |V| + |E|).

Note, this is different from maximum independent set, which is an independent set of the largest possible size and finding that is NP-Hard.

Moron
But that's O(m^2), where m is the size of the independent set you find. For a graph with very few edges, that is close to O(n^2).
Artelius
It is linear in number of edges. In graph problems, the representation matters and linear usually means |V| + |E|. Technically speaking, size of input could be larger than |V| + |E|. Sorry if that was not clear. I will edit the answer.
Moron
NP-Hard, does that mean there is no pseudo P solution either?
Thomas Ahle
@Thomas. No, even subset sum problem is NP-Hard which has pseudo P solutions. NP-Hard = at least as hard as any problem in NP. It has got nothing to do with pseudo P solutions. If that problem is also in NP, then it becomes NP-Complete. I wasn't sure if this was in NP, so didn't mention it.
Moron