This should be quite easy if the conditions you mention are the only ones. The following is but a quick example:
tpe-hkg, hkg-nrt, nrt-hkg, hkg-jfk, jfk-dfw, dfw-sfo, sfo-bos, bos-dfw, dfw-lhr, lhr-hel, hel-nrt, nrt-tpe
Comes to 30,219 miles. I am sure there are other more mileage-maximizing itins.