# Spatial Primitives for AI

This is a catalog of formal computable “primitives” to be used in design artificial intelligence, coming from design computation.

These are the basic building blocks we have to work with, essentially **design patterns** used to model spatial organizations with computable data structures. This post reviews their semantics and respective affordances:

- Foundation Elements
- Mappings
- Grids
- Tilings
- Graphs
- Trees
- Spaces
- Agents

## Foundation Elements

If the primitives above are molecules, these elements are the atoms that comprise them.

Fundamentally, they are *data*, and making the distinction between data and *information* is important.

**Pixels**– “Picture elements,” the smallest units of a raster image, typically arrayed in a grid.**Voxels**– Volumetric pixels, conventionally cubes of “solid” in a gridded three-dimensional**space**of solid and empty cells.**Points**– A point references a location in a coordinate space, typically a singular, multidimensional collection of real numbers.**Vectors**– Related to points, vectors represent change, or the potential for change, along any dimensions relevant to a coordinate or other type of space.**NURBS**– Non-Uniform Rational B-Splines. Points in a coordinate space plus an equation that interpolates between them.**Meshes**– Point clouds mapped to tiled simple polygons (triangles and quadrilaterals). Meshes can be augmented with the semantics of graphs and vectors for workability.

Data are collections of related values of a consistent type, devoid of any meaning. For example, a value like 40ºC intuitively seems like a very hot day, but in actuality the value by itself doesn’t mean much. In the context of *human comfort*, it’s exceptionally hot, even dangerous. But in the context of computer processors, it’s quite cool, well within standard operating temperatures.

This is the essence of information, data plus meaning and context. Given information, we’re well on our way to making decisions, particularly if we can evolve information into knowledge.

## Mappings

A mapping is an association from one domain of data to another, called the range (or codomain).

A “map” is the artifact that results from a mapping operation.

A cartographic *map*, for example, derives from a mapping from the real world to the space of graphic representations, commonly by projecting real, measured space onto a two-dimensional coordinate space. Of course, our modern cartographic maps are more than graphic; they contain data, information, algorithms, and more.

Mappings are fundamental they enable us to associate the computable with the real world, different media with each other, and abstract concepts with more concrete methods. We really couldn’t have computational design without them.

## Grids

A grid is a framework that maps discrete coordinates to:

- individual cells of a tiling, typically rectilinear, and/or
- individual lines of a criss-crossed rectilinear pattern.

With grids, you can index space systematically, mathematically, and consistently. That is, there’s an intuitive mapping between the index (coordinates) and the spatial position, and vice versa. They’re easily scalable, making them an effective means of control.

The grid of pixels on our rasterized screens is the obvious example, which reference each pixel by a pair of numbers.

Grids can have other notions added to their semantics as well, like the neighborliness used in Conway’s Game of Life.

The Manhattan street grid is a classic example of a gridded referential system. (Map below generated at Stamen Design.)

## Tilings

Tilings (aka tessellations) are coverings of a plane or other form with geometric shapes that don’t overlap or contain gaps, often in a symmetrical pattern.

A voronoi tiling used as a heuristic to show the regions closest to the world’s airports.

Such tilings can also be three-dimensional or even multi-dimensional, particularly when considering the dimensions like time, resources, or experience.

## Graphs

Graphs are a network construct of connections, typically consisting of a set of individual nodes connected pairwise to other nodes by edges.

We typically represent graphs with diagrams like the above. Here, circles represent “nodes,” and the arrows between them represent edges, typically used to model connections, like social networks.

More pertinent, graphs can be also used for spatial networking, like the connectivity of street grids:

Graphs demonstrate such flexibility for modeling spatial relationships that they warrant much more attention. More posts on graphs coming soon.

## Trees

Trees are constructs that represent hierarchies.

Decision trees represent the various options available to an agent, given a particular state of the world. Traversing increasingly complex trees is a core area of research in artificial intelligence.

The famous AI systems like DeepBlue and AlphaGo rely on abstract tree-like decision structures. Trees can also be used for static relationships like organizational charts of companies or even dynamic changes like the changing state of a complex system.

## Spaces

“Space” is an expanse of opportunity in which we intend to operate. For spatial AI, the categories of conceptual space and computable space are the most pertinent. Spaces set the rules for our simulations.

On the conceptual side, I define architectural space as “the physical, temporal, and experiential expanse of opportunity around our embodied selves.” Other types, like cyberspace, liminal space, and the like, are variations on this idea.

Computable categories include coordinate, metric, connective, and indexed spaces. For a more complete discussion, see this post.

## Agents

Agents are independent, automatic actors. A single actor can be interesting from some perspectives, but when used in collections, we can simulate the emergent behaviors of more complex systems like crowds of people or vehicular traffic, thus informing design decisions regarding factors that influence such behavior, particularly their environments.

Agent-based models (ABMs) like this can simulate the schooling behavior of fish.

But such models have much more potential. Organizations and collective decision-making can be examined with ABMs. The field of AI is exploring agent models for complex tasks with systems like MetaGPT, in which multiple AI agents based on individually tuned LLMs cooperate to complete more sophisticated reasoning and tasks.

## More Patterns

This is just the start. The more primitives we can formalize, the more sophisticated patterns we can create and build upon.