The Genealogy of Herakles
The sons of Pelops and Hippodameia included Atreus, Thyestes, and Pittheus, and the sons of Perseus and Andromeda included Alkaios, Elektryon, Sthenelos, and Mestor. After marrying daughters of Pelops, Alkaios had a son Amphitryon and daughter Anaxo, Sthenelos had a son Eurystheus, and Mestor had a son Taphios and grandson Pterelaos; as for Elektryon, he succeeded Perseus as king of Mycenae and had a daughter Alkmene by his niece Anaxo.
The descendants of Mestor left the Peloponnese and settled in the Taphian Islands (now called the Echinades) in the Ionian Sea. While Mestor's grandson Pterelaos was king, his sons came to Mycenae and rustled the cattle of king Elektryon. When suitors came for the hand of Elektryon's daughter Alkmene, he told them that the successful suitor would have to accomplish a task which seemed impossible: he would have to recover the cattle taken by the Taphians. Why was this impossible? Because Pterelaos, king of the Taphians, had a magic golden hair on his head which made him immortal and unconquerable.
Elektryon's nephew Amphitryon now joined the suitors and, since he was very wealthy, was able to do the impossible task by paying a great ransom for the cattle. As they were being returned to Elektryon, however, one of the cows charged at the king; Amphitryon threw his club at the cow, it bounced off its horn, and struck Elektryon on the head and killed him.
Even though Elektryon's death was apparently accidental, Amphitryon was forced to go into exile and went north to Thebes to be purified. He was accompanied by his new bride Alkmene, but she told him she would never be his wife unless he really did perform the impossible task and conquer Pterelaos and the Taphians.
When Amphitryon arrived with an army at the Taphian Islands, Pterelaos' daughter Komaitho fell in love with the invader and, while Pterelaos was asleep, she plucked the golden hair from her father's head. As a result Amphitryon was able to kill Pterelaos and conquer the Taphians, and he repaid Komaitho for her help by killing her as well. He then sailed back to Thebes with Taphian plunder, to prove he had been victorious.The story of Pterelaos’ magic hair is an example of a theme found in many myths around the world, sometimes called the “external soul” motif: a man’s strength or life resides in some external object or in some part of the body (such as hair) which normally can be removed without harm. These myths are basically symbolic representations of the wishes and fears associated with the preservation of power and potency.
In the best-known instance of the motif Samson, whose strength lies in his hair, is rendered impotent by the treacherous Delilah, who persuades him to reveal his secret and then cuts off his seven locks of hair; the Philistines confirm the meaning of this deed by blinding Samson, since blinding is a typical symbol of the loss of potency.
A similar story is told of the Cretan king Minos: his enemy Nisos had a magic purple hair, which his daughter Skylla plucked for love of Minos (who then killed her).