Programs are algorithms that operate on data structures (Wirth). How do we turn abstract graphs like those used by C.S. Peirce and Spencer Brown into concrete data structures that algorithms can manipulate? There are many ways to do this, but one very efficient way is through the use of “pointer data structures”.
The full documentation of my Theme One Program is still in progress, but here’s a link to a page of exposition, describing the family of graphs used in the program, how to code the graphs as strings of parentheses, commas, and letters, and how the program parses the strings into pointer structures that live in computer memory.
Here’s a link to a suitable point of entry for our present purpose:
Painted And Rooted Cacti And Conifers
Figure 1 depicts a typical example of a painted and rooted cactus (PARCA).
o a | d o---o o \ / b c | o----o----o b e \ / \ / \ / \ / @ a c e Figure 1. Painted And Rooted Cactus
The graph itself is a mathematical object and does not inhabit the page or other medium before our eyes, and it must not be confused with any picture or other representation of it, anymore than we’d want someone to confuse us with a picture of ourselves, but it’s a fair enough picture, once we understand the conventions of representation involved.
Let be the set of nodes in a graph and let be a set of identifiers. We very often find ourselves in situations where we have to consider many different ways of associating the nodes of with the identifiers in Various manners of associating nodes with identifiers have been given conventional names by different schools of graph theorists. I will give one way of describing a few of the most common patterns of association.
- A graph is painted if there is a relation between its node set and a set of identifiers, in which case the relation is called a painting and the identifiers are called paints.
- A graph is colored if there is a function from its node set to a set of identifiers, in which case the function is called a coloring and the identifiers are called colors.
- A graph is labeled if there is a one-to-one mapping between its node set and a set of identifiers, in which case the mapping is called a labeling and the identifiers are called labels.
- A graph is said to be rooted if it has a unique distinguished node, in which case the distinguished node is called the root of the graph. The graph in Figure 1 has a root node marked by the “at” sign or amphora symbol “”.
The graph in Figure 1 has eight nodes plus the five paints in the set The painting of nodes is depicted by drawing the paints of each node next to the node they paint. Observe that some nodes may be painted with an empty set of paints.
The structure of a painted and rooted cactus (PARC) can be encoded in the form of a character string called a painted and rooted cactus expression (PARCE). For the remainder of this discussion the terms cactus and cactus expression will be used to mean the painted and rooted varieties. A cactus expression is formed on an alphabet consisting of the relevant set of identifiers, the paints, together with three punctuation marks: the left parenthesis, the comma, and the right parenthesis.