An efficient algorithm for the inexact matching of ARG graphs using a contextual transformational model