Fix bug that stoer_wagner ignores weight parameter

This was missed due to lack of a test case.