API reference

API reference

Simulator on random/fixed trees

source

Type of all trees represented by DFS degree sequences

source

A conditional Galton-Watson tree with 2 Bernoulli(1/2) offspring distrbiution.

source
BinaryTree(size::Int)

Construct a BinaryTree of size size.

source

A conditional Galton-Watson tree with Poission(1) offspring distrbiution.

source
CayleyTree(size::Int)

Construct a CayleyTree of size size.

source

Type of conditional Galton-Watson trees represented by DFS degree sequences

source

A DFSWalker does DFS walk on a tree to compute some property of the tree. It should implement at least one of the two functions.

visitfirst(walker::AbstractTreeWalker, degree_sequence, node_index, parent_index)
visitsecond(walker::AbstractTreeWalker, degree_sequence, node_index, parent_index)

The first is called when the DFS walk first enters a node. The second is call when the walk finally leaves the node.

source

A walker computes the depths of all nodes in a tree.

source

Type of fintie trees represented by DFS degree sequences

source

A DFS walker that only needed to be called when the walk enters a node.

source

Representing a fixed directed graph with directed edges stored in an array

source

Representing a fixed graph with edges stored in an array

source

Representing a fixed tree with directed edges stored in an array

source
FixedTreeGraph(size::Int, edges::Array{Tuple{Int, Int}})

Construct a FixedTreeGraph with edges edges of size size.

source
FixedTreeGraph(size::Int)

Construct a FixedTreeGraph with no edges of size.

source

A fixed full-d-ary tree, i.e., in a tree each node has either d or 0 children and each level is full.

source
FullDAryTree(height::Int, d::Int)

Construct a FullDAryTree of height height and maximum degree d.

source

A conditional Galton-Watson tree.

source
GeneralCondGWTree(size::Int, maxdegree::Int, dist::DiscreteUnivariateDistribution)

Construct a GeneralCondGWTree of size size, maximum degree maxdegree, and offspring distribution dist.

source
GeneralCondGWTree(size::Int, maxdegree::Int, dist::DiscreteUnivariateDistribution)

Construct a GeneralCondGWTree of size size and offspring distribution dist.

source

A walker that converts a tree represented in DFS degree sequence to a FixedTreeGraph.

source

Simulation of height of trees.

source

Simulation of the k-cut number of trees.

source

A walker computes the (random) k-cut number of a tree.

source
KcutWalker(k::Integer)

Construct a KcutWalker to compute the k-cut number of a tree.

source

Simulation of the number of leafs.

source

A random recursive tree.

source
RandomRecursiveTree(size::Int)

Construct a RandomRecursiveTree of size size.

source

A walker computes the size of all subtrees of a tree.

source

Simulation of the total path length of trees.

source
Base.sizeMethod.
size(t::FiniteTree)

Return the size of the tree t

source
Base.sizeMethod.
size(graph::FixedGraph)

Return the size of the graph graph

source
CatalanTree(size::Int)

Construct a GeneralCondGWTree with Geometric(1/2) offspring distribution of size size.

source
DAryTree(size::Int, d::Int)

Construct a GeneralCondGWTree with Binomial(d, 1/d) offspring distribution of size size.

source
LogProductSimulator(tree)

Construct a SubtreeSizeSimulator that simulate the sum of log(subtree size) of trees.

source
LogProductSimulator(tree, power)

Construct a SubtreeSizeSimulator that simulate the sum of log(subtree size)^power of trees.

source
MotzkinTree(size::Int)

Construct a GeneralCondGWTree with DiscreteUniform(0, 2) offspring distribution of size size.

source
SizePowerSimulator(tree)

Construct a SubtreeSizeSimulator that simulate the sum of sqrt(subtree size) of trees.

source
SizePowerSimulator(tree, power)

Construct a SubtreeSizeSimulator that simulate the sum of (subtree size)^power of trees.

source
addedge!(tree::FixedGraph, from, to)

Add an edge (from, to) in tree.

source
RandomTree.degreesFunction.
degrees(tree)

Return an iterator that traverses the degree sequence of tree in DFS order.

source
RandomTree.drawtreeFunction.

Draw a grpahic representaion of a tree using graphivz and its Python Interface

source
RandomTree.drawtreeFunction.
drawtree(tree_digraph::FixedGraph, show_label=false)

Draw a graphic representation of tree_digraph

source
RandomTree.drawtreeFunction.
drawtree(tree::FiniteTree, show_label=false)

Draw a graphic representation of the random/fixed tree tree.

source
RandomTree.drawtreeFunction.
drawtree(deg_seq::Vector{Int}, show_label=false)

Draw a graphic representation of tree with DFS degree sequence deg_seq

source
RandomTree.edgesMethod.

Return the array of edges of the graph

source
RandomTree.mainMethod.

Entry point of command line script

source
maxdegree(t::FiniteTree)

Return the maximum degree of the tree t

source
RandomTree.nameMethod.
name(t::FiniteTree)

Return the name of the tree t

source
RandomTree.nodesMethod.

Return the nodes of the graph as an iterator

source
positions(tree::FixedTreeGraph)::Array{Int, 2}

First sort the edges in the tree and then return an array containing the position and length of the segment in the edge array corresponding to each node.

source
print_simulation(sim::AbstractSimulator, nsample)

Print nsample samples in simulation sim.

source
RandomTree.resultMethod.
result(walker::AbstractTreeWalker)

Return of the result of the walk on the tree.

source
simulation(sim::AbstractSimulator, nsample)

Return nsample samples in simulation sim.

source
simulation(sim::SubtreeSizeSimulator)

Return one sample in simulation sim.

source
sortedge!(tree::FixedTreeGraph)

Sort the edges in tree according to starting nodes.

source
RandomTree.treegraphFunction.
treegraph(tree)::FixedTreeGraph

Either convert a fixed tree to a FixedTreeGraph, or generate a random FixedTreeGraph according to tree.

source
RandomTree.walkMethod.
walk(tree::FiniteTree, walker::DFSWalker)

Make walker do a DFS walk on tree.

source

Type of fintie fixed trees represented by DFS degree sequences

source

Type of fintie random trees represented by DFS degree sequences

source

Simulation of the additive function in the form of sum of func(subtree size) applied to random trees.

source

The specification of a tree.

source
TreeSpec(size::Int, name::String)

Construct a TreeSpec of size size and name name.

source

Parse command line arguments

source
visitfirst(walker::AbstractTreeWalker, degree_sequence, node_index, parent_index)

The function is called when the walker first enters a node.

source
visitsecond(walker::AbstractTreeWalker, degree_sequence, node_index, parent_index)

The function is called when the walker finally leaves a node.

source