A practical quantum algorithm for solving structural optimization problems