def _weight_mean_color(graph, src, dst, n):
 diff = (graph.node[dst]['mean color'] - graph.node[n]['mean color'])
 diff = np.linalg.norm(diff)
 return {'weight': diff}

def _weight_mean_color ( graph , src , dst , n ) : diff = ( graph . node [ dst ] [ 'mean color' ] - graph . node [ n ] [ 'mean color' ] ) diff = np . linalg . norm ( diff ) return { 'weight' : diff }
callback to handle merging nodes by recomputing mean color .