def METHOD_NAME(structure, element_priorities):
    """
    Uses the structure options provided by the
    :class:`~iris.fileformats._structured_array_identification.GroupStructure`
    to determine the optimal array structure for the :class:`FieldCollation`.
    The optimal structure is that which generates the greatest number of
    non-trivial dimensions. If the number of non-trivial dimensions is equal
    in more than one structure options then dimension priorities as specified
    by `element_priorities` are used to determine optimal structure.
    Args:
    * structure:
        A set of structure options, as provided by :class:\
        `~iris.fileformats._structured_array_identification.GroupStructure`.
    * element_priorities:
        A dictionary mapping structure element names to their priority as
        defined by their input order to :func:`~optimal_array_structure`.
    Returns:
        The determined optimal array structure or an empty list if no structure
        options were determined.
    """
    permitted_structures = structure.possible_structures()
    if not permitted_structures:
        result = []
    else:
        result = max(
            permitted_structures,
            key=lambda candidate: (
                len(candidate),
                [element_priorities[name] for (name, struct) in candidate],
            ),
        )
    return result