training of graph