Given these nodes:
a b c d e f g h
And given some edges between the nodes like this:
a/b/c b/c/d c/e c/d/e/f c/g f/g e/f/g a/c/h h/a/b c/a d/b/c f/g/c d/a/f g/f g/a/b/c f/a/b e/a/c
(where a/b/c means one edge from a to b, and another one from b to c), so this describes a directed graph.
Here is another, more compact representation for the same graph:
a(b(c(d, e(f), g))) f(g) e(f(g), a(c)) ...
using a tree-like representation. But there are still duplicates in there (e.g.
c are shown twice in the last snippet).
Another way to represent it is like this:
a:b a:c b:c c:d c:e
But this uses even more letters than the original (first) snippet.
Wondering if there is anything better than these 3 approaches to represent a directed graph.
Maybe there is a way to assign numbers to the letters and do all 3 approaches as one. Or maybe something else.
So what could be a representation using the smallest amount of bytes?