line_graph serialization to a file