Return a geographical threshold graph.
The geographical threshold graph model places n nodes uniformly at random in a rectangular domain. Each node is assigned a weight . Two nodes are connected with an edge if
where is the Euclidean distance between and , and , are parameters.
Parameters : | n : int
theta: float :
alpha: float, optional :
dim : int, optional
pos : dict
weight : dict
|
---|---|
Returns : | Graph : |
Notes
If weights are not specified they are assigned to nodes by drawing randomly from an the exponential distribution with rate parameter . To specify a weights from a different distribution assign them to a dictionary and pass it as the weight= keyword
>>> import random
>>> n = 20
>>> w=dict((i,random.expovariate(5.0)) for i in range(n))
>>> G = nx.geographical_threshold_graph(20,50,weight=w)
If node positions are not specified they are randomly assigned from the uniform distribution.
References
[R217] | Masuda, N., Miwa, H., Konno, N.: Geographical threshold graphs with small-world and scale-free properties. Physical Review E 71, 036108 (2005) |
[R218] | Milan Bradonjić, Aric Hagberg and Allon G. Percus, Giant component and connectivity in geographical threshold graphs, in Algorithms and Models for the Web-Graph (WAW 2007), Antony Bonato and Fan Chung (Eds), pp. 209–216, 2007 |
Examples
>>> G = nx.geographical_threshold_graph(20,50)