This is some functions for Pari/GP calculations on labelled oriented trees (graph theory trees) as "vpar" vector of parent vertex numbers.

Vertices are numbered 1 to n and each vpar[v] is its parent, or 0 if no parent. Such a representation is oriented (in that there is a distinguished root or roots), and labelled in that each vertex has a particular number. There are no other attributes etc.

The main use is to calculate or verify properties of specific trees of interest. Various functions like diameter are the same for any root or labelling so effectively act as on a "free" tree. is free software (free as in freedom), published under the terms of the GNU General Public License (v3 or higher). Download version 2 here, (92k, and sig)
vpar-2.tar.gz (69k, and sig)

Just is enough to run. The tar file includes some self-tests and some work-in-progress extras (most of which work but may change wildly). The sig files are Gnu PG ascii armoured signatures generated from my key.

This page Copyright 2017 Kevin Ryde, except for the GPLv3 logo which is Copyright Free Software Foundation and used here in accordance with its terms.

(Back to the sitemap, or the Pari/GP section there).