DOWNLOAD
A plane tree is specified by listing its edges in a counter-clockwise order,
each edge is listed twice (see examples at the end of the program).
At first your should evaluate the cell defining ListEdges,
and perform CheckTree. Optional TheGraph will draw the tree (not
dessign d'enfant yet!).
The actual computation is performed by Main. Running optional
Progress will animate the process of calculation.
When the calculation is over, you'll have the following values:
-
BlackNumber is the number of black vertices;
- WhiteNumber is the number of white vertices;
- BlackRoot[1],...,BlackRoot[BlackNumber] are the posithions of the black vertices;
- WhiteRoot[1],...,WhiteRoot[WhiteNumber] are the posithions of the white vertices;
- BlackMult[1],...,BlackMult[BlackNumber] and
WhiteMult[1],...,WhiteMult[WhiteNumber] are the valencies of the corresponding vertices.
After the calculation is over, the dessin d'enfant of the last calculated tree
can be drawn by executing ShowFinal[].
There are several parameters (such as WorkPrec) that might need adjustment in the case
of a tree with large number of vertices.
The program was checked with
MATHEMATICA
version 9, but most likely it would run with
some earlier versions as well.