Marco Gori Dipartimento di Ingegneria deU'Informazione Universita di Siena Via Roma 56 53100 Siena, Italy Alessandro Sperduti Dipartimento di Informatica Universita di Pisa Corso Italia, 40 56125 Pisa, Italy In the last few years it has been shown that recurrent neural networks are adequate for processing general data structures like trees and graphs, which opens the doors to a number of new interesting applications previously unexplored. In this paper, we analyze the efficiency of learning the membership of DO AGs (Directed Ordered Acyclic Graphs) in terms of local minima of the error surface by relying on the principle that their absence is a guarantee of efficient learning. We give sufficient conditions under which the error surface is local minima free. Specifically, we define a topological index associated with a collection of DOAGs that makes it possible to design the architecture so as to avoid local minima.