add serialization/deserialization tests for graph