Using mathematical optimization, tris to quads.
This add-on needs PuLP.
/Applications/Blender.app/Contents/Resources/4.2/python/bin/python3.11 -m pip install pulp
"C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\bin\python" -m pip install pulp
or
"C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\Scripts\pip" install pulp
Triangular faces are converted to square faces as possible.