def _rcm_estimate(G, nodelist):
 G = G.subgraph(nodelist)
 order = reverse_cuthill_mckee_ordering(G)
 n = len(nodelist)
 index = dict(zip(nodelist, range(n)))
 x = ndarray(n, dtype=float)
 for (i, u) in enumerate(order):
  x[index[u]] = i
 x -= ((n - 1) / 2.0)
 return x

def _rcm_estimate ( G , nodelist ) : G = G . subgraph ( nodelist ) order = reverse_cuthill_mckee_ordering ( G ) n = len ( nodelist ) index = dict ( zip ( nodelist , range ( n ) ) ) x = ndarray ( n , dtype = float ) for ( i , u ) in enumerate ( order ) : x [ index [ u ] ] = i x -= ( ( n - 1 ) / 2.0 ) return x
estimate the fiedler vector using the reverse cuthill-mckee ordering .