Add writing adjacency list to file