Multi-robot task allocation (MRTA) problem is a classical problem in multi-robot systems. The most common assumption in MRTA is that all the tasks need to be completed with the time cost as small as possible. It is worth noting that some tasks may be optional in some real-world situations, i.e., the robots do not necessarily need to complete all tasks. These optional tasks do not limit the achievement of the goal, but the completion of these tasks will lead to some functional effects (e.g., making other tasks easier to be completed). Therefore, these optional tasks can be called “functional task”. Different from functional tasks, if a task must be completed, this task can be called “compulsory task”. In this paper, we study the problem where the robots need to minimize the time cost of completing all compulsory tasks and can selectively complete some functional tasks. The existence of the functional tasks greatly increases the solution space of MRTA, because the functional tasks should be firstly suitably selected and then suitably allocated. Existing related algorithms are usually based on the assumption that all tasks must be allocated. Thus, these algorithms cannot suitably deal with functional tasks. We analyze the characteristics of this problem and present a new hyper-heuristic algorithm. The low-level heuristic (LLH) in hyper-heuristic is designed to score the functional tasks by using influence diffusion model. The high-level strategy (HLS) seeks the optimal values of the key parameters in the influence diffusion model based on particle swarm optimization (PSO). Extensive simulated experiments are presented to comprehensively analyze the proposed algorithm. The proposed hyper-heuristic is compared with greedy algorithm and two meta-heuristic algorithms. Based on the simulated data, it is known that the hyper-heuristic algorithm can outperform the benchmark algorithms especially when the number of functional tasks is large.