Graph serialization