generating a graph, writing to it, reading from is done. defined some contraints on the structure of inputs. refer to week 7 on google drive for details.