Блог пользователя fack

Автор fack, история, 4 года назад, По-английски

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.

can someone solve it in better than O(2^n).

Anyone could help me with LCM constrainsts. Please DM

Thanks

  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Note that for K = 2 this problem is equivalent to finding the number of vertex covers, which is #P-hard.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Even the special case of this problem $$$K=2$$$ (equivalent to counting vertex covers) is #P-complete, because counting solutions to 2-SAT is also #P-complete, and a vertex cover can easily be represented with a 2-SAT formula.

»
4 года назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

Heh, ongoing codechef again. And this is even not exactly correct reduction. Why dont they learn?..