def cost(graph,e):
    
    """
    Return the cost of an edge on a graph.
    
    
    Parameters
    ----------
    G = A networkx graph.
    e = An edge on graph.
    
    Returns
    -------
    The weight of an edge 'e' on a graph 'graph'.

    """
    return graph.edges[e]['weight']