def get_hashable_cycle(cycle):
    """
    Cycle as a tuple in a deterministic order.

    Args
    ----
    cycle: list
        List of node labels in cycle.
    """
    
    # get index of minimum index in cycle.
    m = min(cycle)
    mi = cycle.index(m)
    
    mi_plus_1 = (mi + 1) if (mi < len(cycle) - 1) else 0
    
    if cycle[mi-1] > cycle[mi_plus_1]:
        result = cycle[mi:] + cycle[:mi]
    else:
        result = list(reversed(cycle[:mi_plus_1])) + \
                    list(reversed(cycle[mi_plus_1:]))
        
    return tuple(result)