Line count, file size, and runtime each pointed at a different language, and only one of them matters at run time.

Write the same algorithm three times and you get three different programs. Not different in behavior, but in shape: how many lines it takes, how much space it occupies, and how fast it runs.
The trio in this study was Python, PHP, and Ruby, all implementing one genetic algorithm for the Travelling Salesperson Problem, all passing the same unit tests so that the comparison was between languages and not between programs.
Python won on line count at 237, ahead of PHP at 280 and Ruby at 302. The advantage comes from grammar rather than brevity. Python does not require closing tags on functions or loops, so a routine that spans several lines elsewhere can be written more compactly.
File size reverses the ranking. The Python implementation came to 7771 bytes, more than PHP at 6786 and well above Ruby at 5703. The authors credit Ruby's style, which expresses more per statement, so the shortest program by bytes is the longest by lines.

Neither of those numbers matters if the program is slow. Ruby came out fastest, ahead of Python by 6.5 to 9.99 percent, while PHP trailed Python by 0.22 to 6.09 percent.
The authors also note that the setting can change the ranking. Their own measurements ran outside a web server, and they cite earlier work that found PHP ahead of Python in a web environment. A benchmark answers the question you actually asked, in the environment you actually ran it in.

Their recommendation follows from the measurements rather than from preference: Ruby, for a genetic algorithm of this kind. The scope is honestly small, one algorithm on routes of up to ten cities.
The transferable lesson is the method rather than the winner. If language choice matters to your project, write the core routine in each candidate and time it under realistic conditions. It costs a day and settles an argument that otherwise runs for years.
Pinandito et al. (2018). Web-Based Implementation of Travelling Salesperson Problem Using Genetic Algorithm: A Comparative Study of Python, PHP, and Ruby. arXiv preprint.