Counting spanning trees that satisfy a condition.

38 Views Asked by At

Given a graph, I can count the number of spanning trees of the graph in polynomial time with Kirchhoff's theorem. Now, I have a graph where each edge has a color. There are exactly $3$ edges of each color (and the total number of edges is a multiple of $3$). Now, if I select an edge of a given color, the other two edges of that color should necessarily be excluded from the tree. How do I count the number of spanning trees of the graph that satisfy this condition?