compilation of graph functions