Skip to content

RandomTree

Sebastian Oehms edited this page Nov 22, 2022 · 1 revision

A tree is a connected, acyclic simple graph. By Cayley's formula, there are n**(n-2) distinct (labeled) trees with n nodes. This function creates a random tree on n nodes such that all labeled trees are equally likely to be realized.

Clone this wiki locally