a way to store graphs in computer memory an array of lists is used. the size of the array is equal to the number of vertices. an entry array[i] represents the list of vertices adjacent to the $i$th vertex. this representation can also be used to represent a weighted graph. the weights of edges can be represented as lists of pairs.