ó ŸÃÒYc@s@dZddlZddlZdgZd„Zdd„ZdS(sFunctions for generating trees.iÿÿÿÿNt random_treecCs&gt|ƒD]}tj|ƒ^q S(søReturns a sample of size ``k`` from the given population. ``population`` must be a sequence and ``k`` must be a positive integer. This function returns a list of ``k`` elements chosen uniformly at random from ``population``. (trangetrandomtchoice(t populationtkti((sn/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/generators/tree.pytsample_with_replacements cCsj|dkrtjdƒ‚n|dkr7tjdƒStj|ƒtt|ƒ|dƒ}tj|ƒS(s}Returns a uniformly random tree on `n` nodes. Parameters ---------- n : int A positive integer representing the number of nodes in the tree. seed : int A seed for the random number generator. Returns ------- NetworkX graph A tree, given as an undirected graph, whose nodes are numbers in the set {0, …, *n* - 1}. Raises ------ NetworkXPointlessConcept If `n` is zero (because the null graph is not a tree). Notes ----- The current implementation of this function generates a uniformly random Prüfer sequence then converts that to a tree via the :func:`~networkx.from_prufer_sequence` function. Since there is a bijection between Prüfer sequences of length *n* - 2 and trees on *n* nodes, the tree is chosen uniformly at random from the set of all trees on *n* nodes. isthe null graph is not a treeii(tnxtNetworkXPointlessConceptt empty_graphRtseedRRtfrom_prufer_sequence(tnR tsequence((sn/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/generators/tree.pyR%s    (t__doc__RtnetworkxRt__all__RtNoneR(((sn/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/generators/tree.pyt s