Effects Off
Kolam in Code
Lavannya Suressh
#pulliKolam
#southIndia
#kolampudu
Introduction
Taking a clump of rice flour in a bowl (or a coconut shell), the Kolam artist steps onto her freshly washed canvas: the ground at the entrance of her house, or any patch of floor marking an entrypoint. Working swiftly, she takes pinches of rice flour and draws geometric patterns: curved lines, labyrinthine loops around red or white dots, hexagonal fractals, or floral patterns resembling the lotus, a symbol of the goddess of prosperity, Lakshmi, for whom the Kolam is drawn as a prayer in illustration.
Looking at Kolams, a traditional South Indian art form beyond something that’s a daily ritual, by taking it as a valued precedent for mathematical learning concepts exploring rules that limit yet encourage creativity at the same time. Approaching this art form with code to create generative code-driven art forms following the same traditional rules and structures show that there is more intelligence required to perform this than credited for and a way of looking at Kolams alongside mainstream generative art. Exploring the form through technology, mathematical structures can play an important role valuing contributions to art science and technology from non-western cultures and women.
With our mathematical learnings, it is important to take examples and precedents from our cultures as practices. Pulli Kolam, a South Indian art form, is a great way to study fractals, geometry and looping patterns. Approaching this through code helps enshrine the intricacy of practices, which have, for a very long time due to colonialist epistemologies, seen as ‘primitive’ or ‘primordial’.
The Recipe
A Journey Into Code
There are a set of rules that follow what is specifically identified as a Kolam. They are as follows:
- Loop drawing-lines, and never trace a line through the same route.
- The drawing is completed when all points are enclosed by a drawing-line.
- Straight lines are drawn along the dual grid inclined at an angle of 45°.
- Arcs are drawn surrounding the points.
- Smooth drawing-lines. Lines should not bend in a right angle.
The rules and conventions will be explained in further detail going forward.
Method 1: Looping Kolams Across a Grid
In this method, we will replicate the core method of how the Kolam art is done. The dots are placed in a grid-like structure linearly across a diagonal first as a framework and go around in loops with arcs and straight lines following patterns and symmetry. The grid is however big or small you want the Kolam to be.
For the purpose of keeping simple, we’ll go with a 4-fold symmetry i.e we start with keeping a square (everything is rotated by 45 degrees) in the middle and the pattern repeats on all 4 sides.

There are 3 types of arcs that make up the single line drawing of a Kolam. They are all based on having 1, 2, and 3 curved sides of a square. The radius of the curved sides is half the side-length of the square. Assigning these numerical values to each type can be processed by the looping function.

There are a set of rules that we follow while traversing across the grid to make up what distinctively identifies as a Kolam. The rules are illustrated in Figure 3 and Figure 4 below showing two case scenarios:
- If the direction of traversing through the grid is the same.
- If you’re traversing to the next row of dots.


Tips
- A Kolam always ends with loop type 3 maintaining the rule of leaving no loose ends behind.
- Type 0 is a straight line that needs to be drawn to start looping Kolams in the next grid.
- The forward looping is straightforward with numerical values 0, 1, 2 and 3. This can be inputted into the system in the form of an array.
- Since a Kolam ends at loop type “3” so the input arrays are limited to types 0, 1 and 2 and appended at the end with type 3.
Looping Back with a Grid
We follow a set of rules to loop back after we get to loop type “3” to form the closed loop structure of a Kolam. It is illustrated in Figure 5 below.
- Loop type 1 is looped back with loop type 1
- Loop type 2 is followed back with loop type 0
- Loop type 0 is followed back with loop type 1

Kolam [3] is the most basic type of Kolam, The Kolams get increasingly complex based on the length of the array entered. Following these simple rules we will develop a recursive function to make a Kolam.
Below are the few examples of Kolams we can derive with the method discussed above.

A Recursive function where you go around the grid in a user inputs directing how you go around the grid with rectangles with a radius of curvature in different combinations of the sides and the code computes how this is looped back to form a Kolam. This method has a lot more scope in terms of scalability and application of data, artificial intelligence etc. while taking Kolams forward.
Each number corresponds to one block of code that does the following as shown in Figure 7:

There are some import mathematical concepts we can explore through Kolams:
- Symmetry
- Fractals
- Array grammars
- Infinity
Method 2: Kolam Tiles and Shapes
Another way we can look at Kolams is based on the shapes that constitute it. This is a method derived from looking at the outlook of what a finished Kolam looks like and how it can be represented.
We will visually approach it by placing tiles in a framework. There are 6 types of tiles in different orientations shown in Figure 8:

These shapes are based on curved sides of the square in different permutations. Let’s denote curved sides as 1 and pointed sides as 0. Taking a clockwise convention, the corners a, b, c and d can take binary values of 0 and 1.

The framework of the grid is similar to a cartesian system but we consider only the coordinates from a diagonal. The framework is illustrated above in Figure 9.
Each side has 2 possible values and there are 4 sides so totally there are 2x2x2x2 permutations of shapes. This can be compared to hexadecimals with 4 bytes of data each taking either a value of 0 or 1. Figure 10 shows all the permutations of shapes. There are 16 shapes that make up a Kolam and can be denoted with hex codes.

The grid where we place our Kolam shapes is important to understand and represent the Kolam structure. It is similar to a simple cartesian coordinate system in a diagonal orientation. We can structure a Kolam through this with a few simple rules. Figure 11 shows the grid structure and the corresponding coordinate values. Imagine a regular cartesian system rotated clockwise by 45 degrees. This is the convention we are following here.

We have the constant (0,0) space where usually the symmetry of the Kolam surrounds. We will look at how the Kolam rules conform around the grid at any given value x and y. Figure 12 shows the grid structure.

The rules that we follow while constructing a Kolam are the following:
- The sum of the x and y value should be divisible by 2
- Adjacent blocks have the same value at the point the joining point to maintain the single line drawing rule
- Endpoints of Kolams must end with a “1”
axy refers to the “a” value of the (x,y) coordinate of the tile, The rules are for all the valid tiles around it. They are Illustrated in Figure 13 below:

This is very similar to data communication in 4-bit computers where the bit values need to match to progress through making a Kolam. Figure 14 shows a few examples of generated Kolams. Although this can be extended in any way following the given set of rules, maintaining some level of symmetry is part of the aesthetic of what makes up a Kolam. This generative method of computing Kolams across a space can have a lot of scope for understanding data and communication.
In computer architecture, 4-bit integers, or other data units are those that are 4 bits wide. Also, 4-bit CPU and ALU architectures are those that are based on registers, or data buses of that size. Memory addresses for 4-bit CPUs are generally much larger than 4-bit, such as 12-bit or more, while they could in theory be 8-bit. A group of four bits is also called a nibble and has 2⁴ = 16 possible values.
Some of the first microprocessors had a 4-bit word length and were developed around 1970. Traditional 4-bit computers are by now obsolete, while recent quantum computers are 4-bit, but also based on qubits, such as the IBM Q Experience. See also: Bit slicing and bit-sliced quantum computers.

Q&A
What is the context or background that inspired your recipe?
While growing up I used to see my grandmother perform Kolams as a part of her daily morning ritual. There were different Kolam patterns everyday, and different ways of thinking involved. All this was from pinching rice flour between your fingers. I never questioned why this is the way it is or paid too much attention to it growing up, it was just an everyday thing. I once asked her where she learnt this from and she told me about her mother how talented she was and how if she had an education or a degree in mathematics she would be brilliant. She also mentioned how the present generation is “too-cool” to learn and take up these traditions. There is a lot of mention of mathematics and structure associated with the Kolam art form but this was something I wanted to dive deep into and explore for myself. More so see what Kolam can do for mathematics over what mathematics can do for Kolams.
Which community are you offering the recipe to?
The community this recipe is relevant to would be the younger generation learning through a playful exploration of Kolams where we involve code, computing and technology to make generative explorations. Even for mathematicians and computer scientists, there are concepts where Kolam can be a good precedent to learn from.
How does your submission relate to intersectional feminism?
Throughout history there were gendered exclusions in tech centric fields and the intelligence required to draw increasingly complex Kolams have been undervalued. Exploring the form through technology, mathematical structures and taking it as a cultural precedent to learn mathematical concepts from can play an important role valuing contributions to art science and technology from non-western cultures, and from women.