Genealogy of Eurystheus and Hercules (Herakles) Based on Apollodorus 2.4.5
Perseus, great-grandfather of Hercules, was the son of Zeus and Danae. Perseus and Andromeda had 5 sons in Greece:
Sthenelus, with Nicippe, another daughter of Pelops, had daughters named Alcyone and Medusa, and later a son named Eurystheus. Amphitryon married his 1st cousin and niece Alcmene. Together they had a son named Iphicles. Zeus also mated with Alcmene and through their union Alcmene gave birth to Hercules.