Dynamic routing algorithm based on local information in a free-scale network