Back in 2012, a redditor by the name of "Kepleronlyknows" wondered what's the longest distance you could travel by sea without hitting land. And then s/he hazarded an educated guess: "you can sail almost 20,000 miles in a straight line from Pakistan to the Kamchatka Peninsula, Russia."
Six years later, two computer scientists--Rohan Chabukswar (United Technologies Research Center in Ireland) and Kushal Mukherjee (IBM Research in India)--have developed an algorithm that offers a more definitive answer. According to their computations, "Kepleronlyknows was entirely correct," notes the MIT Technology Review.
The longest path over water "begins in Sonmiani, Balochistan, Pakistan, passes between Africa and Madagascar and then between Antarctica and Tierra del Fuego in South America, and ends in the Karaginsky District, Kamchatka Krai, in Russia. It is 32,089.7 kilometers long." Or 19,939 miles.
While they were at it, Chabukswar and Mukherjee also determined the longest land journey you could take without hitting the sea. That path, again notes the MIT Technology Review, "runs from near Jinjiang, Fujian, in China, weaves through Mongolia Kazakhstan and Russia, and finally reaches Europe to finish near Sagres in Portugal. In total the route passes through 15 countries over 11,241.1 kilometers." Or 6,984 miles. You can read Chabukswar and Mukherjee's research report here.