A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/088723.html below:

(Not too off topic I hope?) problem

(Not too off topic I hope?) problem (Not too off topic I hope?) problemDuncan Smith buzzard at urubu.freeserve.co.uk
Wed Apr 18 11:22:06 EDT 2001
I am trying to get an MCMC algorithm (based on a tree structure) implemented
/ prototyped in Python.  I have a problem figuring out how to efficiently
randomly select a tree edge (ie. with prob = 1/(n-1)) when the tree is a
dictionary {node: [adjacency list], ...}.  If I randomly select a node and
then an adjacent node, the probability of selecting the edge (defined by the
pair) depends heavily on the tree structure.  The solution I currently have
is potentially less efficient than generating all the edges from the
dictionary and selecting one at random.  Any ideas.  Thanks in advance.

Duncan



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4