An algorithm for preferential selection of spectroscopic targets in LEGUE