[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#30711] [PATCH 1/1] guix: graph: Add Trival Graph Format (TGF) backe

From: Hartmut Goebel
Subject: [bug#30711] [PATCH 1/1] guix: graph: Add Trival Graph Format (TGF) backend.
Date: Mon, 5 Mar 2018 22:12:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Am 05.03.2018 um 18:17 schrieb Ludovic Courtès:
> Can you tell us more about the Trivial Graph Format? 

This is a *very* simple format, see You can only define
nodes, edges and labels. Edges are always directed. I don't know whether
it is wide-spread. By chance I used it to import data into yEd
(non-free, by chance mentioned in the Wikipedia-article), which allows
to select quite some different graph layouts.

So the first decision should be whether TFG should be included.

(Alternativly, for importing into yEd, a simple GraphML should work,
too.So I could implement that, which might be of more widespread use.)

>> -(define (emit-edge id1 id2 port)
>> +(define (emit-edge id1 label1 id2 label2 port)
>>    (format port "  \"~a\" -> \"~a\" [color = ~a];~%"
>>            id1 id2 (pop-color id1)))
> This is orthogonal to adding a new format, so it should probably be a
> separate patch.

Will split up, when TGF backend is accepted.
>> +(define (emit-tgf-edge id1 label1 id2 label2 port)
>> +  (format port "~a ~a~%" label1 label2))
> This is probably incorrect because labels do not necessarily uniquely
> identify nodes.  This is why the API distinguishes node identifiers and
> labels.

Following you answer bug #30710 (graph gives duplicate edges) this is
true and this implementation is wrong.

TGF requires all nodes to be defined prior to any of their edges,
otherwise the edge's Ids will be taken as labels. Thus the export-graph
needs to be changed to first emit all nodes and then the edges. Due do
my little guile-knowledge I did not manage to change the code accordingly.

Hartmut Goebel

| Hartmut Goebel          | address@hidden               |
| | compilers which you thought are impossible |

reply via email to

[Prev in Thread] Current Thread [Next in Thread]