 Diodorus, however, reports that it was completed by Ptolemy II after being fitted with a lock.Ptolemy II was the first to solve the problem of keeping the Nile free of salt water when his engineers invented the water lock around 274/273 BC.In the 2nd century AD, Ptolemy the Astronomer mentions a "River of Trajan", a Roman canal running from the Nile to the Red Sea.