Who invented diagrammatic algebra?

I'd say C.S. Peirce, from about 1882 until his death, was a very early practitioner with his Existential Graphs. This is a tripartite diagrammatic algebra or calculus that deals with propositional logic, first-order logic with equality, and modal logic. I (with Gerry Brady, who is an expert on Peirce) have argued here and there their kinship with Feynman diagrams and string diagram calculus.


Frege's formalisation of first-order logic from the end of the 19th century uses a two-dimensional formalism, see e.g. here.

Konrad Zuse, inventor of the first computer, also developed the first high-level programming language, the Plankalkül which uses a 2-dimensional notation

Plankalkuel

Programming languages where indentation is syntactically relevant are making a comeback, e.g. Python and Haskell.

Przytycki, in his Classical roots of knot theory traces the history of braid diagrams, including this one of Gauss'.

Gauss braid


I believe diagrammatic algebra started with 19th century invariant theorists. See Section 2 of my JKTR article "On the volume conjecture for classical spin networks" as well as Section 8 of this article for more elaborate explanations, but I can briefly show some examples here. The earliest article I know which contains diagrammatic algebra, although in rudimentary form is the 1857 paper "On the theory of the analytical forms called trees" by Cayley (see page 172). Here are some excerpts:

enter image description here

enter image description here

The use of diagrams for representing classical polynomial invariants or covariants was then introduced by Clifford in his 1878 article "Extract of a letter to Mr. Sylvester from Prof. Clifford of University College, London". This was followed by the 1878 article "On an application of the new atomic theory to the graphical representation of the invariants and covariants of binary quantics, with three appendices" by Sylvester. However, a more substantial development of the corresponding diagrammatic algebra was due to Kempe in the 1885 article "On the application of Clifford's graphs to ordinary binary quantics" as should be clear from this excerpt

enter image description here

which contains some diagrammatic equations (things like: 2 X picture-3 X another picture = yet another picture) and the diagrams for the 4 generating invariants of binary quintics (see the next page for the 19 remaining generating covariants).

Finally and in relation to Todd's answer, it is interesting to note that there was an exchange of ideas going on between Kempe and Peirce with regards to such diagrammatic way of doing math. See this very nice article by Grattan-Guinness for more on this story.


Edit: I should also mention the earlier 1846 article "On linear transformations" by Cayley (see page 104). Previously, the only examples of invariants were produced by elimination theory, e.g., the discriminant of a hypersuface in $\mathbb{P}^n$ pointed out by Boole. In his article Cayley showed how to produce an unlimited supply of invariants using contraction of indices (he did not say it that way) between elementary tensors for the ground form and the Levi-Civita epsilon. Assembling these elementary tensors essentially is a diagrammatic construction, although the corresponding pictures only appeared in print in the later articles by Clifford, Sylvester, Buchheim and Kempe. Cayley's procedure in fact produces all $SL_n$ invariants and this is called the FFT but he did not prove this in his 1846 article. As far as I know the first proof was found by Clebsch in 1861 as I explained in this MO answer.