Data structures for several types of graphs