The first line of the input contains T, the number of test cases.
The first line of each test case contains the integers N and M.
The next M lines of each test case each contain two integers x and y (1≤x≤y≤N), denoting that there exists an edge between x and y in G.
Consecutive test cases are separated by newlines for readability.
For each test case, the number of distinct G′ modulo 109+7 on a new line.
7 4 6 1 2 2 3 3 4 1 3 2 4 1 4 5 5 1 2 2 3 3 4 4 5 1 5 5 7 1 2 1 3 1 5 2 4 3 3 3 4 4 5 6 6 1 2 2 3 3 4 4 5 5 6 6 6 6 7 1 2 2 3 1 3 1 4 4 5 5 6 1 6 10 10 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 22 28 1 2 2 3 3 4 4 5 5 6 6 7 1 7 1 8 3 9 8 10 10 11 10 12 10 13 10 14 11 15 12 16 13 17 14 18 9 15 9 16 9 17 9 18 15 19 19 20 15 20 16 21 21 22 16 22
These are some larger test cases. Make sure to output the answer modulo 109+7. Note that the answer for the second-to-last test case is 245(mod109+7).
All test cases in input 3 satisfy N≤5.
All test cases in inputs 4-5 satisfy M=N−1.
For all test cases in inputs 6-11, if it is not the case that fG(x,b)=fG(y,b) for all b, then there exists b such that fG(x,b) is true and fG(y,b) is false.
Test cases in inputs 12-20 satisfy no additional constraints.
Problem credits: Benjamin Qi