简体   繁体   中英

Where k <=4 find every k-tuple in O(|V|) time

Here is the Context to my question:

I have a homework question: Describe a linear time algorithm in the size of the vertices (ie O(|V|)) to determine if there is a max clique in a graph where all the vertices have a max degree of size 3. I know that there is a polynomial time algorithm to do this. What I'm struggling to come up with is an O(|V|) algorithm to do this. Also, I do realize that the largest a clique could be is of size 4.

Here is where I keep getting stumped:

It seems to me that at some point along the way you would need to enumerate all k-tuples of size 4. But how can this be done in O(|V|) time?

Also of note, is that I have tried playing around with dynamic programming to solve this, but I fail to see how to do this in linear time.

Answers, thoughts, suggestions?

Finding every k-tuple in O(|V|) time is not possible because the desired output is larger than the complexity you want to achieve. But actually, finding a max-clique doesn't require you to find all k-tuples. The only k-tuples you have to consider are the one that forms a neighbourhood of some vertex (including the vertex itself).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM