def random_layout(G, center=None, dim=2):
 import numpy as np
 (G, center) = _process_params(G, center, dim)
 shape = (len(G), dim)
 pos = (np.random.random(shape) + center)
 pos = pos.astype(np.float32)
 pos = dict(zip(G, pos))
 return pos

def random_layout ( G , center = None , dim = 2 ) : import numpy as np ( G , center ) = _process_params ( G , center , dim ) shape = ( len ( G ) , dim ) pos = ( np . random . random ( shape ) + center ) pos = pos . astype ( np . float32 ) pos = dict ( zip ( G , pos ) ) return pos
position nodes uniformly at random in the unit square .