lm317 has a 1.5 amp rating and can regulate up to 35 volts.
7805 in TO220 also goes up-to 1.5A. You shall consider lm317 only if you need to optimize your stock or nonstandard/trimmable voltages are needed.
This circuit is one why you could possibly want to use LM317, thou lot of new LDO's offer even better performance/precision:
Just one question: why use the LM317 as well as the TL431 when the LM317 will do on its own?
Is there any advantage to using an LM317 over fixed regulators like an L7818 or 7805?
Yes, it actually has better characteristics. Compare the data sheets. It also allows you to do things like bypass R2 with a capacitor, to increase the ripple rejection.
So you suggest having a 20-24V power supply stepped down to 18V via a linear regulator and then a 5V linear regulator... OP asks for 18V/325mA + 5V/200mA that is a total of 6.85W available power plus the power converted to heat from the regulators....
My approach is a common 5v-2A power supply delivering the 5V to begin with and a booster module to create an 18V rail
Good quality 5v-2A wall converter like this https://tinyurl.com/y88ysqt3 cost 5.44$ and a booster module like this https://tinyurl.com/yd9zceu7 for a total of 6$ and an extremely small footprint too which as i get it is also required. No heat issues to solve, no heatsinks to take space etc....
The parts required to build the booster with MT3608 are as little as 1 ic 1 diode 1 inductor a couple resistors and capacitors... total cost for parts alone can be as little as 0,20$ !!!
There's no right or wrong way. Both ways are valid. 5V to 18V might be more convenient, as it's probably easier to get hold of a 5V 10W PSU, than an 18V PSU which isn't overkill, but it's not necessarily better.
Using a higher voltage, before the long piece of cable, then stepping it down at the other end, is better than doing the reverse. For the same thickness and length of cable, transmitting 10W of power will be more efficient at 18V than 5V. Work it out. Think about the current needed, the resistance and power loss, in the cable, at different voltages.
Given the choice, assuming equal cost and availability of parts, I'd choose an 18V 1A mains power supply and a 5V buck converter, over a 5V PSU and 18V boost converter. Another thing is regulation: the 5V rail probably needs to be better regulated, than the 18V rail and having only a short PCB trace between the 5V buck and device will result in better voltage regulation
You'll find a similar scheme used in laptops. An 18V to 20V PSU used to charge the batteries and a some step-down converters to provide the various lower internal voltages to power the device.