Aloha steko, Stefano Costa <[email protected]> writes:
> However, a more recent version of the program I described in 2007 can > be found here > https://gitorious.org/harris-matrix/harris-matrix and I know a similar > approach has been used by the pyArchInit QGIS plugin. The source code has been very helpful. Thank you for pointing to the most recent code. Your code calls the acyclic method of pyGraphViz, which relies on the GraphViz utility called acyclic. The man page for that utility says: acyclic is a filter that takes a directed graph as input and outputs a copy of the graph with sufficient edges reversed to make the graph acyclic. In effect, the utility will take one or more stratigraphic observations and silently invert them. This is probably not what the user wants. Also, the call to tred in your code precedes the removal of cycles. Note that the man page for tred says: If a graph has cycles, its transitive reduction is not uniquely defined. In this case tred emits a warning. If you change the order of the calls, like this: B=self.A.acyclic(copy=True) # make sure there are no cyclic relations C=B.tred(copy=True) # remove redundant relations then you will generate a uniquely defined transitive reduction, but will still possibly invert stratigraphic observations without the user's knowledge. Also, the problem of the graphs not looking nice enough for your colleagues can be ameliorated somewhat by exporting to svg, rather than png. I use the open-source Inkscape program to edit Harris Matrices produced by GraphViz dot. It works like a charm! All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com -- Mailing list info: http://lists.linux.it/listinfo/archaeology
