The most fundamental of Hindu deities, is the Trinity of Brahma, Vishnu and Shiva - popular deities include Ganesha, Krishna, Hanuman and goddesses like Lakshmi, Durga,Saraswati.
Shiva and Parvati were playing with their two sons, Ganesha and Kartikeya (or Murugan, as he is known to the Tamils). They had been given a fruit by the gods and both the sons wanted it. The divine couple explained to the sons that this fruit had in it the nectar of Supreme Knowledge and Immortality, and since both wanted it, the one who circled the world three times and came back first would get it as a prize. Kartikeya got on to his vehicle, the peacock, and flew into space, stopping at all sacred spots on the way and offering his prayers Ganesha knew that, with his corpulent form weighing him down, his vehicle, the mouse, would go even slower than usual and he could never beat Kartikeya. But his wisdom taught him a solution. He walked round his parents, Shiva and Parvati, three times, with great devotion. When his parents asked him why he was not circling the globe, he answered - My parents, Shiva and Shakti are the whole world. Within them is the entire universe. I need go no further. Naturally he won the fruit. This incident highlights the importance of intelligence, of which Ganesha is a repository, as against strength or speed or physical achievements.
The same story is altered in another Purana according to which Shiva and Parvati asked both their sons to race round the world thrice. The one to win would be married first.Ganesha won by circumambulating his parents three times, who then married him to the daughters of ishwaroopa, Siddhi (Achievement or Success) and Buddhi (Wisdom) In most parts of India Vinayaka is considered a celibate but in some parts of the country he is considered married to these beautiful girls, a symbolic marriage to emphasise the importance of wisdom and success in removing obstacles.