There are a lot of different ways doing this and they're really based on certain tradeoffs such as memory requirements, speed of certain operations, modifying the graph, determining the neighbors of a vertex, etc. 