A dynamical systems approach to weighted graph matching