Ancestors of Perseus and Hercules

               Zeus___Io
                    |
                 Epaphus
                    |
       Poseidon___Lybia
                |
              Belus
   _____________|________
   |            |       |
Aegyptus     Danaus     | 
   |            |       |
Lynceus___Hypermnestra  |
        |               | 
       Abas             | 
        |               | 
     Acrisius           |
        |               |
      Danae___Zeus   Cepheus___Cassiopea 
            |          ______|
            |          | 
         Perseus___Andromeda
            _____|______
            |          |
        Electryon   Alcaeus
            |          |
  Zeus___Alcmene___Amphitryon
       |         |
    Hercules  Iphicles

cited from: Hamilton, Edith. Mythology. Little Brown & Company, January 1950.

Even though there is apparent incest in this family tree, it is not nearly as incestual as the relationships in the Family Tree of the Principal Gods of Greek Mythology.

See:
Hercules
Perseus
The Genealogy of the Greek Gods and Goddesses of Mythology Metanode