def _get_weights(G):
    """
    Returns a list of the weights in the graph.
    """
    Graph_data = list(G.edges_iter(data=True))
    return [Graph_data[ii][2]['weight'] for ii in range(len(Graph_data))]