reorder_nodes function

Reorder nodes in an FFT definition