In recent years, there has been a growing global trend towards transitioning from centralized energy systems to distributed or decentralized models, with the aim of promoting the widespread utilization of renewable energy sources. As a result, the concept of direct energy trading among consumers has garnered considerable attention as a means to effectively harness the potential of distributed energy systems. However, in this decentralized trading scenario, certain consumers may encounter challenges in receiving electricity from their preferred suppliers due to limited supply capacities. As a result of this constraint, there is a reduction in the advantages enjoyed by consumers. While previous studies have predominantly focused on optimizing resource allocation efficiency, the issue of equitable consumer benefits has often been overlooked. Therefore, it is crucial to develop a trading mechanism that considers the preferences of market participants, in addition to balancing supply and demand. Such a mechanism aims to enhance both fairness and efficiency in the market. This paper introduces the formulation of a single-objective optimization and multi-objective optimization problem for an electricity market trading mechanism. To address this challenge, two single-objective algorithms and six evolutionary algorithms (EAs) are employed to solve the optimization problem. By analyzing the simulation results, this study demonstrates the efficacy of the chosen evolutionary algorithms (EAs) and a single-objective optimization approach in effectively optimizing both the utilization of resources and the equitable distribution of consumer benefits.