This is some functions for Pari/GP making calculations on labelled oriented trees (graph theory trees) as "vpar" vector of parent vertex numbers. Functions include
Vertices are numbered 1 to n. A tree is a vector
vpar[v] is parent of
0 if no
parent. Such a representation is oriented in that there is a distinguished
root (or roots for a forest) 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 and the vertex numbers just for tree creation. Most functions are linear in the number of vertices so can be used on large trees.
The connections to Pari/GP specifics are at polynomials and
Set()s for independent sets etc, matrices for some linear algebra
or eigenvalues etc, permutations in relabelling, and then general compactness
of GP for experimenting etc.
vpar.gp(415k, and sig), or compressed
vpar-6.tar.gz(479k, and sig)
vpar.gp is enough to run. The
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
gentreeg in the
Nauty tools which generates free
trees in this kind of vertex parent form (among other forms) and can be used
command line or C.
This page Copyright 2017, 2018 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).