2

I have been assigned a homework problem that I cannot figure out:

Prove that SAT has a polynomial-time reduction to the language of undirected non-negative weighted graphs with simple cycle of weight less that or equal to w.

This bears a resemblance to the all-pairs shortest path problem which has polynomial-time algorithms, but I've read multiple times that this problem is np-hard (plus, I suppose it would be a cruel trick to give such an assignment).

Starting from hamcycle, I have managed to produce a reduction for several variations on this problem (e.g., tsp, longest positive path, shortest negative path), but whenever it comes to this language I can always come up with a counterexample that invalidates my attempt at a reduction.

So, is there a reduction from SAT? What am I missing?

Raphael
  • 73,212
  • 30
  • 182
  • 400
user55567
  • 21
  • 1

1 Answers1

1

In the spirit of "give a man a fish, and he'll be fed for a day; teach a man to fish, and he never need be hungry again", I'll share with you some problem-solving techniques that might be helpful for approaching this problem (and other problems) -- but I'm not going to spoil it for you by solving your exercise for you.


Technique #1: If you don't know how to solve a problem, change the problem: look for "nearby"/"similar" problems you do know how to solve. If you can't reduce SAT to the original language, is there some related/variant language you can reduce SAT to? You may need to try multiple variants, and get a feeling for which ones you can easily find a reduction for and which ones you struggle with. This may give you some intuition about what the barrier/difficult part of your problem is, which may help you identify what aspect to focus your energy on.

Hint #1 (possible spoilers):

If you changed "less than or equal to w" to "equal to w", would the problem be any easier? What if you changed it to "greater than or equal to w"?


Technique #2: You can chain reductions. If you can reduce SAT to some variant, and reduce that variant to the original problem, you're in business.

Hint #2 (possible spoilers):

It seems that short cycles are a headache. If you have a graph $G$, can you think of some way to transform it to remove all short cycles (without changing whether or not it contains a cycle of length $w$)? (If you can't immediately see how to do it, can you write out a precise specification of what such an algorithm would need to do?)


And that's as much as I'm going to say. It's a good exercise, and it's your exercise, so you should have the chance to play around with it and discover a solution for yourself. It's tricky but doable.

D.W.
  • 167,959
  • 22
  • 232
  • 500