'Returns a dictionary of the form::
{ \'nodes\': <a list of node dictionaries>, \'edges\': <a list of node dictionaries> }'

def as_dict(self):

    return {'nodes': list(self.gen_node_dicts()), 'edges': list(self.gen_edge_dicts())}
