28.1.4.2 Adjacency List (ADJ_LIST)
Note:
Adjacency List (ADJ_LIST) format is deprecated. Instead, use Comma-Separated Values (CSV) format.The Adjacency List format is a text file format containing a list of neighbors from a vertex, per line. The format is extended to encode properties. The following shows a graph with V vertices, having N vertex properties and M edge properties:
<V-1> <V-1, VP-1> ... <V-1, VP-N> <V-1, VG-1> <EP-1> ... <EP-M> <V-1, VG-2> <EP-1> ... <EP-M> <V-2> <V-2, VP-1> ... <V-2, VP-N> <V-2, VG-1> <EP-1> ... <EP-M> <V-2, VG-2> <EP-1> ... <EP-M> ... <V-V> <V-V, VP-1> ... <V-V, VP-N> <V-V, VG-1> <EP-1> ... <EP-M> <V-V, VG-2> <EP-1> ... <EP-M>
Note that trailing separators will be considered as errors. For example, if whitespace is used to separate the properties, then any trailing whitespace will cause an exception to be raised.
Example 28-3 Graph in Adjacency List Format
This example shows a graph with 4 vertices (1, 2, 3 and 4), each having a double and a string property, and 3 edges, each having a boolean and a date property, encoded in Adjacency List format:
1 8.0 "foo"
2 4.3 "bar" 1 false "1985-10-18 10:00:00"
3 6.1 "bax" 2 true "1961-12-30 14:45:14" 4 false "2001-01-15 07:00:43"
4 17.78 "f00"
Note:
ADJ_LIST is more space efficient than EDGE_LIST. This is because vertices are first defined and then the edges are being created, indicating that we are repeating each vertex at least once. EDGE_LIST is a lot easier to read but if you wish to store big graphs, then ADJ_LIST is recommended in order to save disk space.Parent topic: Plain Text Formats