I was given the following algorithm as a solution to one of my problems. However, I am baffled at understanding how c' is ever initialized. The first if statement can never be reached, as c' is never set the first time. Can someone explain this to me? Am I just missing where c' gets set?

This is for Kleinberg and Tardos, Chapter 11, Question 12.

enter image description here

  • 3
    $\begingroup$ It’s a typo - should be $c’=$ instead of $c’-$ in line 5. $\endgroup$ – Yuval Filmus Dec 11 '18 at 0:23
  • 1
    $\begingroup$ Hey @YuvalFilmus, thanks. My professor sent this to me with NO explanation, just that my initial answer was wrong and this was right... Can you please post that as an answer so that I may accept it as a correct answer? $\endgroup$ – wundermahn Dec 11 '18 at 0:25

Posting Yuval Filmus's comment as an answer since they didn't:

It’s a typo - should be $c’=$ instead of $c’-$ in line 5.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.