def ordered(state):
    """Returns an ordered version of the state (to improve node pruning)."""
    sorted_state = sorted(zip(state[::2], state[1::2]))
    return tuple(item for subl in sorted_state for item in subl)