What trajectory turns out to be the most optimal for a spacecraft flight from Earth to Mars?

The trajectory should have the smallest semi-major axis. In this case, the velocity at perihelion will be minimal and, therefore, the fuel consumption for its communication will also be minimal. Such a limiting orbit is the Homan elliptical orbit, in which Mars is located in aphelion.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.