separate data structures for input and output graph