Storing Graphs in the Graph Store

It’s fine to enter the graph data interactively, but it can get a little tiresome after a while. We’d rather read our graphs back from a filestore, so we’ll need to be able to write the graphs out to some text format—that is, to serialize the graph data structures—for disk-based storage.

The libgraph package includes two serialization functions in the Graph module: to_dot/1 and to_edgelist/1. The former renders the graph using the well-known DOT format from the Graphviz[10] distribution, while the latter is a plaintext rendering of graph edges suitable for using with graph libraries such as the igraph[11] library.

We’ll work with the DOT format here as this is a common serialization used by many software packages ...

Get Exploring Graphs with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.