On most excavations the large number of stratigraphic units and contexts makes it necessary to use some sort of representation of the relative chronological sequence to keep track of what has already been excavated (not to mention building archaeology). This tool is the Harris Matrix.
It can be defined as a directed graph from the most recent down to the older deposits, where the nodes represent layers, that are connected through stratigraphic relations (edges).
This year in Gortyna I tried to use the Graphviz software for automating the creation of the Harris Matrix for the excavation area I was in.
UPDATE: I've published a first draft of a simple application to automate the generation of the Harris Matrix. Read more here.

There are two steps involved here:
For installing Graphviz, you should follow the instructions for the operating system you are using: it is straightforward in most cases. The most important thing you ought to know before diving into this brief tutorial is that GV is not a GUI application, i.e. you don't draw your graph, but rather you describe it in a text file. The file is then processed using one of the many programs that Graphviz If you can't live without buttons and menus, try Dia, that can export also in Graphviz .dot format. Dia is a GTK+ based diagram creation program for Linux, Unix and Windows released under the GPL license.
Graphviz has its own native, plain text format, that is documented on the website. Graphviz .dot files can be read and written with any text editor like kate, gedit, jedit or notepad++. Keeping a file of this kind is the obvious choice for an experiment, but of course the single-file approach has also lot of problems.
This is a sample from the final .dot file I had compiled during the excavation weeks:
digraph matrix {
723->722
505->732
729->732
731->730->729
726->729
730->726
726->810->725
729->810->725
729->733->792->793
722->731
732->737->736->733
733->810->725
729->505
736->506
505->506
179->759
759->725
759->737
759->769->768->778
768->303
737->739->736->778
736->769
778->303
506->303
769->506
769->780
778->779
736->773->774->779->780
779->303
780->303
506->780
505->724
}A -> B means “A comes after B”. You can also concatenate multiple relations on the same row. Indenting is not mandatory, but it helps keeping your file clean. You can write comments on any line after a # character, like# this is a comment A -> B -> C A -> D -> E # this one too!
dot.dot harris-matrix.dot -Tpng -o harris-matrix.png
-Tpng command line option specifies which one of the many available output formats we want to get. The -o flag precedes the output filename.
tred is another of the many tools provided by Graphviz, that acts as a “transitive reduction filter for directed graphs”. So, it has to run before dot reads the input file. A pipe (represented by the | character) is the easiest way to pass data from one program to another in UNIX style. Here's how I did it:tred harris-matrix.dot | dot -Tpng -o harris-matrix-tred.png
dot by default accepts input from stdin, while tred by default uses stdout as output. Many simple programs that do one single operation, well done: this is the core of the UNIX philosophy, and Graphviz follows it. Once you understand this concept, things will be much easier.
<span style="color:#888;">digraph matrix { # these two options go at the beginning of the graph file</span>
concentrate=true;
node[shape=rect];
Comments
i need help
i cannot figure out how you removed the redundant relations. Where do I enter the tred command? Is there anything I need to download first? Your help would be greatly appreciated. Thank you, D.
if you have the Graphviz
if you have the Graphviz suite installed on your system, you should have the
tredcommand available. This means that you can calltred filename.dotfrom a terminal emulator. My instructions are probably easier to follow on a GNU/Linux system than on Windows. I am (slowly) writing the second part of this tutorial and probably that will include a user-friendly graphical interface.Thanks for your interest. If you still encounter problems, let us know.
re:help
Hi again,
I'm using Mac OS X Leopard - and Graphviz 1.13 (v16). Does this have tred? Can I use terminal to run this program?
Thank you
- D.
I think your Graphviz
I think your Graphviz version is quite outdated (the Pixelglow binaries are based on an old and unmantained version of Graphviz)). The last stable version is 2.16 and you can download it from http://www.ryandesign.com/graphviz/
Let me know if the new version works.