Knowee
Questions
Features
Study Tools

The subgraph-isomorphism problem takes two undirected graphs G1 and G2, andit asks whether G1 is isomorphic to a subgraph of G2. Show that the subgraph-isomorphism problem is NP-complete.

Question

The subgraph-isomorphism problem takes two undirected graphs G1 and G2, andit asks whether G1 is isomorphic to a subgraph of G2. Show that the subgraph-isomorphism problem is NP-complete.

🧐 Not the exact question you are looking for?Go ask a question

Solution

To show that the subgraph-isomorphism problem is NP-complete, we need to demonstrate two things:

  1. The problem is in NP.
  2. The problem is NP-hard.

Step 1: The problem is in NP

To show that the subgraph-isomorphism problem is in NP, we need to demonstrate that a given solution can be verified in polynomial time. Given two graphs G1 G1 and G2 G2 , and a mapping f f from the vertices of G1 G1 to the vertices of G2 G2 , we can verify whether f f is an isomorphism from G1 G1 to a subgraph of G2 G2 in polynomial time by checking the following conditions:

  • f f is a bijection between the vertices of G1 G1 and a subset of the vertices of G2 G2 .
  • For every edge (u,v) (u, v) in G1 G1 , there is an edge (f(u),f(v)) (f(u), f(v)) in G2 G2 .

Both of these checks can be done in polynomial time, so the subgraph-isomorphism problem is in NP.

Step 2: The problem is NP-hard

To show that the subgraph-isomorphism problem is NP-hard, we need to reduce a known NP-hard problem to it in polynomial time. We will use the clique problem, which is known to be NP-hard.

The clique problem asks whether a given graph G G contains a complete subgraph (clique) of size k k . We will reduce this problem to the subgraph-isomorphism problem.

Given an instance of the clique problem, i.e., a graph G G and an integer k k , we construct an instance of the subgraph-isomorphism problem as follows:

  • Let G1 G1 be the complete graph Kk K_k on k k vertices.
  • Let G2 G2 be the graph G G .

We need to determine whether G1 G1 (the complete graph on k k vertices) is isomorphic to a subgraph of G2 G2 . If G G contains a clique of size k k , then there exists a subgraph of G G that is isomorphic to Kk K_k . Conversely, if G1 G1 is isomorphic to a subgraph of G2 G2 , then G G contains a clique of size k k .

This reduction can be done in polynomial time, and since the clique problem is NP-hard, the subgraph-isomorphism problem is also NP-hard.

Conclusion

Since we have shown that the subgraph-isomorphism problem is in NP and is NP-hard, we can conclude that the subgraph-isomorphism problem is NP-complete.

This problem has been solved

Similar Questions

Which of the following statements is not true for isomorphic graphs?a.Number of vertices in both the graphs must be same.b.Number of edges in both the graphs must be same.c.They have n+1 connected componentsd.Degree sequence of both the graphs must be same.

Graph isomorphism is concerned with:A. The number of vertices and edgesB. The degrees of verticesC. The labeling of vertices and edgesD. The structural equivalence of graphs

Define complete graph and complete bipartite graph. Draw a graph which is a complete graph as well asa complete bipartite graph.

SubgraphsProblem DescriptionGiven a graph of N nodes and E bidirectional edges, determine how many disjoint subgraphs there are in the graph. For this case, a portion of a graph is considered a subgraph if any 2 node in the portion are connected directly or indirectly. A node without any edges are also considered as a subgraph. Two disjoint subgraph will not have any edges in between any node of the first subgraph and any node of the second subgraph.The nodes are labelled from 0 to N - 1 and there will not be 2 edges between any 2 pairs of nodes.Input2 integers, N then EE lines consisting of 2 integers each, A and B. 0 ≤ A < B < N.OutputA single integer, which is the number of disjoint subgraphs.LimitsSubtask 1 (45%): N = 1000, 0 ≤ E ≤ 10000.Subtask 2 (55%): N = 1000000, 0 ≤ E ≤ 1000000.Subtask 3 (0%): As per sample testcasesSample Testcase 1Input:5 31 23 44 0Output:2Explanation:The graph above contains 2 disjoint subgraphs: {1, 2} and {0, 3, 4}Sample Testcase 2Input:5 40 11 22 33 4Output:1

A graph that is both bipartite and complete is:A. PlanarB. TreeC. CycleD. Complete bipartite graph

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.