2 representation of graph