What contributed to the rise of the Middle Kingdom?

successful battles with neighboring kingdoms
the rule of weak pharaohs during the Old Kingdom
the construction of a canal between the Nile River and the Red Sea
the formation of a central government under the Old Kingdom