Suppose I have a weighted graph with equal positive weight (let it be K) on each edge. Now I want to count the number of ways to assign weights to vertices SUCH THAT if there is an edge between X and Y then max(W[X], W[Y])=K where W[X] means assigned weight to vertex X.
It's better if someone could come up with O(n^3) solution but O(n^4) will also work.
Anyone could help me with LCM constrainsts. Please DM
Thanks