Some German words just cannot be hyphenated properly by the package. Especially those that consists actually of two or more words. For these words use:
\hyphenation{Ele-men-tar-ob-jek-te Op-ti-mie-rungs-pro-blem} Seperate the words with a space character, like in the example.
Edit 1:
A full example:
\documentclass[12pt,a4paper]{report} \usepackage{amsmath} \usepackage{amsthm} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage[utf8]{inputenc} \usepackage{hyphsubst} \usepackage[ngerman]{babel} \hyphenation{Ele-men-tar-ob-jek-te Op-ti-mie-rungs-pro-blem} \begin{document} Text of my document... \end{document} Edit 2:
See here. Sorry, it's German, but it's meant to help the author.