I am stuck on the following graph problem: How many k-colorings (exactly k, k is a constant) of a sparse graph of n vertexes (n <= 50000) with no connected component of size s having more than s + 2 edges (almost tree).
I am completely stuck!!!
Could someone give me a hint? It's a problem from Hong Kong Regional Online Preliminary 2016 (all of their problems are super hard).