Chitrakāvya seal

Chitrakāvya चित्रकाव्य

A research project · A new computing paradigm

A scholarly companion · the chess-puzzle that is a hymn

Pādukāsahasra,
the knight's tour in 1300 CE.

A 1,008-verse devotional epic on the sandals of a deity at Śrīraṅgam. Inside it, two verses — numbered 929 and 930 — solve the knight's tour on a half-chessboard, half a millennium before Euler. This page assembles the primary Sanskrit, the lineage that produced it, and the modern mathematics that recognises what was being done.

Vedānta Deśika · 14th c. · Anuṣṭubh metre · 32 + 32 syllables

"…rangaraja-padaṁ naya." Pādukāsahasra · ch. 30 · verse 929

The artefact

Two verses that share their bones.

In the thirtieth chapter of the Pādukāsahasra — a chapter Vedānta Deśika titles the Citra-paddhati, "the path of figures" — sit two verses that look, to a modern reader, like an impossibility. Both are thirty-two syllables long, both are in classical anuṣṭubh metre, both praise the sandals of Lord Raṅganātha at Śrīraṅgam, both make grammatical and devotional sense. And the second is the same body of syllables as the first, re-ordered by a knight's tour over a 4×8 half-chessboard.

The poetic figure that licenses this is called the chaturaṅga-turaṅga-pāda-bandha — "binding by the foot-step of a chess-knight." It is the most ambitious instance in classical Sanskrit of the broader chitrakāvya impulse: encode a single object in three media at once — sound, shape, and rule.

Verse 929 · sequential reading

The seed.

Padukasahasra 30.40 · Vedānta Deśika · ca. 1300 CE

स्थिरागसां सदाराध्या विहताकरताम्भुजा ।
सत्पादुके सरसा मा रङ्गराजपदं नय ॥ sthirāgasāṁ sadārādhyā · vihatākaratāmbhujā satpāduke sarasā mā · raṅgarāja-padaṁ naya

A reading. "O virtuous sandal — adored ever by those of steady offences, you who have crushed the lotus-faced sin-bearer; lead me, full of feeling, to the foot of the king of Raṅga." The verse is a prayer; it is also the seed for what comes next.

Below, the thirty-two akṣaras of verse 929 are placed in row-major order on a 4×8 half-board.

Verse 930 · knight's-tour reading

The reading that the knight produces.

Padukasahasra 30.41 · same chapter, immediately following

स्थिता समयराजत्पागतरामादके गवि ।
दुरंहसां सन्नतादा साध्या तापकरासरा ॥ sthitā samaya-rājat-pāgata-rāmādake gavi duraṁhasāṁ sannatādā sādhyā tāpa-karāsarā

Verse 930 is composed of exactly the same thirty-two syllables as verse 929, in a new order — the order in which a chess-knight visits the squares of the half-board. Both verses are metrical, both are grammatical, both make devotional sense.

On the page below, every cell carries two syllables: the syllable verse 929 places there, and (in smaller type) the position that syllable will occupy in verse 930 after the knight's tour. Cell n's "tour position" tells you when in the second verse you will hear that syllable.

→ Full interactive walk-through
Want the full interactive demo with audio recital and synced knight? See Knight's Tour for the live walk and Visuals for the modern English analogues by Donald Knuth.

Lineage

Three knight's tours, three centuries.

Vedānta Deśika did not invent the device — he perfected it. The chitrakāvya tradition records two earlier instances of a knight's tour bound into a verse, both from the 9th century in Kashmir. Looking at all three side by side is the cleanest way to see the problem moving.

Rudraṭa c. 850 CE · Kashmir
Kāvyālaṅkāra · 5.15

Rudraṭa रुद्रट

The earliest known instance of a knight's tour in any literature. Rudraṭa's Kāvyālaṅkāra presents the figure as a poetic ornament — turagapadabandha, "the foot-step of a horse." A pair of meaningful verses where the second is the knight's-tour reading of the first.

Ratnākara c. 850 CE · Kashmir
Haravijaya · canto 6

Ratnākara रत्नाकर

The longest extant Sanskrit mahākāvya — 4,351 verses across fifty cantos. The sixth canto, the Bhagavatstutivarṇana, contains an elaborated knight's tour fitted into a hymn to Śiva, contemporary with Rudraṭa but more devotionally extended.

Vedānta Deśika c. 1300 CE · Śrīraṅgam
Padukasahasra · 30.40–41

Vedānta Deśika वेदान्तदेशिक

The synthesis. A devotional epic of 1,008 verses in praise of a deity's sandals; chapter 30 deploys forty bandhas; verses 929 and 930 deliver the knight's tour at its tightest and most expressive. Tradition says the entire epic was composed overnight.

A comparative table

What the three artefacts share, and what they don't.

Author / work Date Board Syllables Subject
RudraṭaKāvyālaṅkāra 5.15 c. 850 CE 4 × 8 (half-board) 32 + 32 Poetic ornament
RatnākaraHaravijaya ch. 6 c. 850 CE 4 × 8 (half-board) 32 + 32 Hymn to Śiva
Vedānta DeśikaPādukāsahasra 30.40–41 c. 1300 CE 4 × 8 (half-board) 32 + 32 Praise of Raṅganātha's sandals
Leonhard EulerSolution d'une question curieuse 1759 CE 8 × 8 (full board) First Western analysis

The Sanskrit instances precede Euler by nine hundred years. They work on a half-board because that is the form the metre demands — anuṣṭubh gives 32 syllables, four pādas of eight, and 4 × 8 = 32.

Why this matters as computer science

The constraint, not the answer, is the artefact.

It is tempting, but wrong, to reduce the Padukasahasra to "an early knight's tour." The knight's tour is the easy part. There are millions of valid Hamiltonian paths on a 4×8 board, and any one of them permutes 32 syllables. The hard part, and the part that no Western treatment captures until very recently, is that the permutation must leave behind a second meaningful verse in metre. This is a joint constraint over three independent specifications:

  1. the syllables form a Hamiltonian path on the 4×8 knight graph;
  2. the syllables, read in the path's order, scan as anuṣṭubh;
  3. the resulting Sanskrit is grammatical, devotional, and beautiful.

For a modern audience this is recognisable as a constraint-satisfaction problem with a fitness function. The Sanskrit poets did not have the vocabulary, but they had the practice — and they had it nine centuries before the vocabulary arrived. The Padukasahasra is a working solution to a problem we would now phrase as: find a permutation π of a 32-element string s such that π(s) is also a sentence in a given natural language and a given metre, and π itself is a Hamiltonian path on the knight graph K(4,8).

Read further

Primary editions and modern scholarship.

For the interactive walk over verse 929, see Knight's Tour; for the modern English chitrakāvya by Donald Knuth that puts the same form into English, see Visuals.