convert between adj_list and snap graph obj