def edges_on_ring(ring):
    """
    Get all the edges from a ring.
    :param ring: THe ring in which to obtain the edges.
    :return: A set of edges..
    """
    edges = set()
    prev = ring[-1]
    for c in ring:
        edges.add(frozenset({prev, c}))
        prev = c
    return edges