This paper studies the cluster consensus of multi-agent systems (MASs) with objective optimization on directed and detail balanced networks, in which the global optimization objective function is a linear combination of local objective functions of all agents. Firstly, a directed and detail balanced network is constructed that depends on the weights of the global objective function. Secondly, two new continuous-time optimization algorithms are proposed based on time-invariant and time-varying cost functions to ensure that all agents reach cluster consensus within a fixed-time, and the global objective function asymptotically reaches the optimal solution. Finally, two examples are presented to show the efficacy of the theoretical results.