Genealogy - Eurystheus and Hercules - From Apollod. 2.4.5
Perseus, great-grandfather of Hercules, was the son of Zeus and Danae. Perseus and Andromeda had 5 sons in Greece:
Alcaeus
Sthenelus
Heleus
Mestor
Electryon
and one daughter, Gorgophone.
Alcaeus and Astydamia, daughter of Pelops, had a son named Amphitryon and a daughter named Anaxo. Electryon and Anaxo had a daughter named Alcmene (Alcmena) and sons
Stratobates
Gorgophonus
Phylonomus
Celaeneus
Amphimachus
Lysinomus
Chirimachus
Anactor
Archelaus.
Sthenelus, with Nicippe, daughter of Pelops, had daughters named Alcyone and Medusa, and later a son named Eurystheus. Amphitryon married Alcmene. Together they had a son named Iphicles. Zeus also mated with Alcmene and through their union Alcmene gave birth to Hercules.