The hedgehog's dilemma, or sometimes the porcupine dilemma, is an analogy about the challenges of human intimacy. It describes a situation in which a group of hedgehogs all seek to become close to one another in order to share heat during cold weather. They must remain apart, however, as they cannot avoid hurting one another with their sharp spines. Though they all share the intention of a close reciprocal relationship, this may not occur for reasons they cannot avoid.
Both Arthur Schopenhauer and Sigmund Freud have used this situation to describe what they feel is the state of individual in relation to others in society. The hedgehog's dilemma suggests that despite goodwill, human intimacy cannot occur without substantial mutual harm, and what results is cautious behavior and weak relationships. With the hedgehog's dilemma, one is recommended to use moderation in affairs with others both because of self-interest, as well as out of consideration for others. The hedgehog's dilemma is used to justify or explain introversion and isolationism.
The concept originates from German philosopher Arthur Schopenhauer's Parerga und Paralipomena, Volume II, Chapter XXXI, Section 396. In his English translation, E.F.J. Payne translates the German "Stachelschweine" as "porcupines." Schopenhauer's parable describes a number of hedgehogs who need to huddle together for warmth and who struggle to find the optimal distance where they may feel sufficiently warm without hurting one another. The hedgehogs have to sacrifice warmth for comfort. Schopenhauer draws the conclusion that, if someone has enough internal warmth, they can avoid society and the giving and receiving of psychological discomfort that results from social interaction.
It entered the realm of psychology after the tale was discovered and adopted by Sigmund Freud. Schopenhauer's tale was quoted by Freud in a footnote to his 1921 essay Group Psychology and the Analysis of the Ego. Freud stated that his trip to the United States in 1919 was because: "I am going to the USA to catch sight of a wild porcupine and to give some lectures."
Social psychological research 
The dilemma has received empirical attention within the contemporary psychological sciences. Jon Maner and his colleagues (Nathan DeWall, Roy Baumeister, and Mark Schaller) referred to Schopenhauer's "porcupine problem" when interpreting results from experiments examining how people respond to ostracism and other forms of social rejection. Their results revealed that, for people who are chronically anxious, the experience of rejection led people to be relatively anti-social; but among people with more optimistic dispositions, the experience of rejection led to intensified efforts to get close to others. They concluded,
This last point is worth remembering when one considers the answer that Schopenhauer himself supplied to the porcupine problem. Schopenhauer suggested that people ultimately feel compelled to retain a safe distance from each other. "By this arrangement," he wrote, "the mutual need for warmth is only very moderately satisfied; but then people do not get pricked" (1851/1964, p. 226). Of course, Schopenhauer was known for his sour temperament – "It is hard to find in his life evidences of any virtue except kindness to animals... In all other respects he was completely selfish" (Russell, 1945, p. 758) – and his philosophy was famous for its pessimism.
Cultural references 
- Hedgehog's Dilemma is the name of an experimental/electronic project started by Timothy Hester from Stockton, California.
- In Qian Zhongshu's novel Fortress Besieged, a character explicitly deliberates about the dilemma.
- The Hedgehog Dilemma is the title of the debut EP from hip-hop artist Alex Frecon. 
- Hedgehog's Dilemma is the title of a song and EP by Jani Galbov (Maxis).
- Hedgehog's Dilemma" is the title of a two-part song spanning the second and third tracks of The Postman Syndrome's release "Terraforming."
- Porcupine's Dilemma is the title of a poem by Stephen Wack which examines the attempt at integration of retaining distance while being involved with love and relationships.
- The Hedgehog's Song is a song by The Incredible String Band, on their album "5000 Spirits or the Layers of the Onion"
- Robotman is a song by the pillows on their album "Thank You, My Twilight", which contains a reference with the lyrics "hedgehog's dilemma" in English.
- The theme of the hedgehog’s dilemma was reprised in the Italian song "Istrice" (Italian word for "hedgehog") by Turinese band Subsonica in 2011.
- Hedgehog's Dilemma is the English name of the fourth episode of the anime Neon Genesis Evangelion, in reference to Shinji's struggles in forming relationships with people, and is used as a continuing theme throughout the series.
- The Hedgehog Song occurs frequently in Terry Pratchett's Discworld novels.
- The Hedgehog's Love is a song by Vocaloid, Hatsune Miku, of which she sings about the Hedgehog Dilemma.
- "The Porcupine Illusion". Cabinetmagazine.org. Retrieved 2011-08-08.
- "CABINET // The Porcupine Illusion". Cabinetmagazine.org. Retrieved 2011-08-08.
- "Maner, J.K., DeWall, C.N., Baumeister, R.F., & Schaller, M. (2007). Does social exclusion motivate interpersonal reconnection? Resolving the 'porcupine problem.' ''Journal of Personality and Social Psychology'', 92, 42–55." (PDF). Retrieved 2011-08-08.
- "''ibid'', p. 54." (PDF). Retrieved 2011-08-08.
- 0.00. "Hedgehog's Dilemma's sounds on SoundCloud - Hear the world’s sounds". Soundcloud.com. Retrieved 2013-02-28.
- [dead link]
- "Maxis – Hedgehog's Dilemma EP (File, MP3) at Discogs". Discogs.com. 2010-02-05. Retrieved 2011-08-08.
- "The Postman Syndrome – Terraforming (staff review)". Sputnikmusic. Retrieved 2011-08-08.
- [dead link]
- "Hedgehog song – Discworld & Pratchett Wiki". Wiki.lspace.org. 2012-09-23. Retrieved 2012-11-21.