The Ottawa Senators announced Tuesday that they have traded forward Mike Hoffman to the San Jose Sharks after allegations that his fiancée harassed captain Erik Karlsson’s wife.

The Senators sent Hoffman, defenseman Cody Donaghey and a 2020 fith-round pick to San Jose in exchange for forward Mikkel Boedker, defenseman Julius Bergman and a 2020 six-round pick.

Ottawa general manager Pierre Dorion said the move was made with the intent of “improving chemistry, leadership and character in the locker room and on the ice.”

“We are confident it is a step in the right direction for the long-term success of this organization,” Dorion said in a statement.

Hoffman, averaging 26 goals per season over the past four seasons, has been far more productive than Boedker in their careers, but his trade value was diminished by accusations that his fiancée Monika Caryk had been accused of cyberbullying Melinda Karlsson, wife of Ottawa star Erik Karlsson.

Hoffman, with two years left on his contract paying him an average of $5.25 million, has been the subject of trade rumors since the…