Question

Show the following problem is in NP (nondeterministic polynomial time):

Given two graphs G1 = (V1, E1) and G2 = (V2, E2), are they isomorphic? Recall that two graphs are said to be isomorphic if th

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let the input x be two graphs G1 and G2 and let y be the indices {i1,i2,···,in}.

An algorithm A(x,y) verifies that the graphs are isomorphic by executing the following steps:

(a) Check if y is a permutation of {1,2,···,n}.

If no, return false; else continue.

(b) Permute the vertices of G1 as given by the given permutation. Verify that the permuted G1 is identical to G2.

Step (a) takes at most O(V^2) time and step (b) runs in O(V+E) time, therefore the verification algorithm A runs in O(V*2) time. Hence the problem is NP-complete.

Add a comment
Know the answer?
Add Answer to:
Show the following problem is in NP (nondeterministic polynomial time): Given two graphs G1 = (V1,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT