Graph linear serialization/deserialization