in Algorithms
579 views
0 votes
0 votes

Please explain how to solve this??

What is the upper bound of computing time of m coloring decison problem for n nodes?

a. O( n m)

b. O( m n)

c. O( n m n )

d. O( m n m )

e. O( n m m n )

in Algorithms
by
579 views

2 Comments

I do not think we can have an upper bound of computing time for PROBLEMS. Event to do 1+1, I can do 

while(1){} return 1+1;

which will take infinite time. 

0
0

Key says answer is O( n m n )

I wonder how to solve this?!

0
0

1 Answer

1 vote
1 vote
Generally the solution of m-coloring on n vertex graph can be represented as an array c[1..n], where c[i] represents color of vertex i. A brute-force method will generate $m^n$  assignments. Verifying these $m^n$ options on n vertices in worst case will take n$m^n$ time. So, $O(nm^n) $ will be the upper bound.