0

I currently have a program that solves subgraph isomorphism. It will return 1 if there is an isomorphic subgraph and 0 if there is not.

I'm trying to use this implementation to solve the clique problem (whether or not a graph G contains a clique on k vertices). I've been stuck on this for a while so any help is appreciated.

79t97g
  • 105
  • 1
  • 1
  • 9

1 Answers1

2

If you mean the following for the subgraph isomorphism:

the subgraph isomorphism problem is a computational task in which two graphs G and H are given as input, and one must determine whether G contains a subgraph that is isomorphic to H.

Indeed you solved the problem. If a subgraph of G is isomorphic to K_m (a clique with m number of vertices), it contains a clique with the size of m (and if it is not true, it does not contain any clique with size m).

OmG
  • 18,337
  • 10
  • 57
  • 90
  • Since the clique problem only takes in 1 graph, G, what would be the second graph that my isomorphic subgraph program takes in? I think that's the part where I'm stumped. – 79t97g Nov 19 '19 at 17:43
  • 2
    The second graph is the reduced, isolated k-clique. – Prune Nov 19 '19 at 17:48
  • Thanks. I guess I'm still confused on how to get the k-cliques from the original graph. Is there some pseudocode I can look at for that? – 79t97g Nov 19 '19 at 18:02
  • The problem in your question isn't to find the cliques, just to answer "yes" or "no" about whether a clique exists. – kaya3 Nov 19 '19 at 19:55