putting an Iowa-class battleship on permanent patrol off the coast of Somalia would end the whole pirate/hostage problem commercial vessels are encountering there.
I know a Marine who was part of the peacekeeping force in Beruit in the 1980s.
I think he was on an amphib offshore at the time the New Jersey cut loose and sent a barrage of shells over the city and into Syrian positions on the hills above it. Said there wasn’t so much as small arms fire (let alone anything heavier) in the city for a couple weeks afterwards.
One Predator drone running up and down the coast, with an operator given authority to put a Hellfire missile into any Somali boat venturing into the commercial shipping lanes, would end Somali piracy right there, and do it cheaper.
It all comes down to having the willingness to do what's necessary.
Putting armed security on shipping vessels has largely ended Somali piracy. In 2013, there were only 9 attempted hijackings (0 successful) down from 237 in 2011.