Microsoft interview question

Q. Cycle detection in weighted graphs