Effects Off


Kolam in Code

Lavannya Suressh





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:

  1. Loop drawing-lines, and never trace a line through the same route.
  2. The drawing is completed when all points are enclosed by a drawing-line.
  3. Straight lines are drawn along the dual grid inclined at an angle of 45°.
  4. Arcs are drawn surrounding the points.
  5. 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.

A Kolam grid comprised of a 5X5 array of orange dots with a diamond with a blue stroke in the center with horizontal and vertical lines of symmetry drawn.
Figure 1. Image credit: Lavannya Suressh.

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.

Types of Kolam curves derived from 1, 2 and 3 sides of a rectangle, curved. Each type is depicted vertically stacked on top of each other in dark blue with orange.
Figure 2. Image credit: Lavannya Suressh.

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:

  1. If the direction of traversing through the grid is the same.
  2. If you’re traversing to the next row of dots.
An image of loop type 3 that shows why a Kolam ends there and no transition takes place and representation possible curve 1 and 2 transitioning to all 3 other curve types maintaining the same direction in a Kolam grid stacked on top of each other.
Figure 3. Image credit: Lavannya Suressh.
A representation of all 3 possible curve types transitioning to all 3 other curve types changing the direction (changing the row of dots of the pattern) in a Kolam grid.
Figure 4. Image credit: Lavannya Suressh.
  • 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.

  1. Loop type 1 is looped back with loop type 1
  2. Loop type 2 is followed back with loop type 0
  3. Loop type 0 is followed back with loop type 1
A Kolam example of how you loop pack when you’ve gone forward with a certain looptype on top of eachother with a 4 step illustration on making the most basic Kolam with a 3X3 grid a blue diamond at the center with 4 loops sitting at the corner of each diamond.
Figure 5. Image credit: Lavannya Suressh.

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.

4 examples of Kolams following the loop array method of making them with the first two Kolams on the top being a design with a 3x3 grid and the next two designs on the row below it being Kolams in a 5x5 grid with a blue line showing how to draw the forward loop of a Kolam and a dotted orange line to show how you loop back a Kolam forming the design.
Figure 6. Image credit: Lavannya Suressh.

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:

A flowchart of code composed of five orange diamonds, depicting each operation. The first step can either be “User Input” or “Randomized Input.” The next steps are: “Forward Loop based on entered Array”, “Reverse back and to get to position 0”, and then finally “Rotatate 45 degrees, repeat 3 times.”
Figure 7. Image credit: Lavannya Suressh.

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:

The six types of Kolam shapes next to each other with sides of a square with a blue stroke rotated at 45 degrees curved in different permutations with each shape having a red dot in the middle.
Figure 8. Image credit: Lavannya Suressh.

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.

a diamond with a blue stroke with a circle with a pink stroke inscribed inside it with the 4 sides of the diamond being touched by the circle, the image next to it shows deconstructing the given shapes cutting them in 4 different ways with a vertical and horizontal line showing us 4 different types of deconstructions with a blue stroke.
Figure 9. Image credit: Lavannya Suressh.

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.

A depiction of all possible Kolam shapes. There are 16 shapes in dark blue assembled to form a 4x4 grid. Each shape is slightly different based on the combination of steps, which are depicted in orange text beneath each shape.
Figure 10. Image credit: Lavannya Suressh.

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.

A series of smaller diamond shapes assembled in a 3x3 grid form a larger diamond in dark blue. This represents the Kolam Grid structure. In the center where the diamonds connect with each other there are orange dots. Each diamond has a numbered position assigned to it.
Figure 11. Image credit: Lavannya Suressh.

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.

Alt-text: A series of smaller diamond shapes assembled in a 3x3 grid form a larger diamond in dark blue. This represents the Kolam Grid structure. In the center where the diamonds connect with each other there are orange dots. Each diamond has x and y coordinate positions assigned to it.
Figure 12. Image credit: Lavannya Suressh.

The rules that we follow while constructing a Kolam are the following:

  1. The sum of the x and y value should be divisible by 2
  2. Adjacent blocks have the same value at the point the joining point to maintain the single line drawing rule
  3. 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:

On the left the equations for constructing a Kolam are depicted in dark blue text. To the right are two forms of diamond shapes stacked on top of each other. The left shape highlights the interaction of the two forms in orange. The right shape is all dark blue.
Figure 13. Image credit: Lavannya Suressh.

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.

This image depicts multiple completed Kolam. Dark Blue lines curve and intersect each other against a grid of orange diamonds. Where the blue lines encircled with curves there are orange dots in the center. There are three major forms. The top and bottom are slightly smaller, with the middle form offset to the left.
Figure 14. Image credit: Lavannya Suressh.


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.

Back To Top