added classes for serialization of graph, and a util class