Fix bug: int was used instead of double for calculation of mod diff
(edge weights are not integer values)

Signed-off-by: Tzu-Li Tai <tzulitai@ee.ncku.edu.tw>