Add support for different types of graphs