Obviously something can be sub-optimal or poor, minimal, bad or terrible... But is there a word that means the exact opposite, the antonym, of optimal?
Taking the classical approach, optimal derives from optimus, the Latin superlative to bonus, meaning good.
Looking at the Latin for bad, that is malus.
bonus -> melior -> optimus
malus -> peior -> pessimus
So analogous to optimus becoming optimal, pessimus would become pessimal.
All that said, I have never heard that word used.
We do use plenty of the forms of Latin good and bad, as in ameliorate, pejorative, optimal, optimist and pessimist. However, pessimal never seems to have made it far in the popularity contests - it did get into the dictionaries though!
Since pessimal is correct in the worst possible way, I would look more carefully at the specific usage. One common antonym in discussions of algorithms that would probably fit many usages is "worst-case." You will often see optimal and worst-case performance contrasted as well as optimal (aka best-case) scenarios and worst-case scenarios.
If you trust on WordNet (http://wordnetweb.princeton.edu/):
optimum, optimal (most desirable possible under a restriction expressed or implied)
antonym: worst [Indirect via best] ((superlative of `bad') most wanting in quality or value or condition) "the worst player on the team"; "the worst weather of the year"
Generally this requires a sentence, because as tribal monkeys we like to dwell on bad situations and defeats.
It was the very abject point of hopelessness
things were as bad as they could ever be
he had given up all hope
But here are some words you could try; Horrid, abject, hopeless, worst, dreadful, awful, woebegone, abysmal, dire.
Around here (IT department) the phrase the Murphy way of doing things is commonly used as opposite of the optimal way of doing things.
Derived obviously from "Murphy's Law":
Anything that can go wrong, will go wrong, at the worst possible moment, causing maximum damage.
May not be generally suitable, but for us it works.