'TGF Graph creating and viewing
I have some questions related to creating and displaying a graph created with the TGF extension.
Is it enough to describe my graph in this manner into a blank file with the .TGF extension ?
1 First node
2 Second node
#
1 2 Edge between the two
Is it enough to write it like this from Java into that file ?
Also how am i supposed to view the graph's drawing ? I have no clue.
Solution 1:[1]
TGF files require this information only. I have created such graphs with these information alone. Maybe some one else can give a clearer answer. :)
When it comes to view the graph, you can use yEd graph Editor (http://www.yworks.com/en/downloads.html#yEd)
As a start, open the graph with yed. Set Tools -> Fit Nod to Label and then use an appropriate layout from Layout menu. Ex: Layout -> Hierarchical -> Orientation -> Top to Bottoom -> OK
Seems TGF format is not expected to keep information about the formation of the graph unlike other complex formats such as GraphML
Solution 2:[2]
In adition to @isuru answer: If you use this file:
0 R0
1 R1
2 R2
3 R3
4 R4
5 R5
6 R6
#
0 1 1
1 4 1
1 5 1
2 3 1
3 6 1
5 6 1
6 1 1
6 2 1
You will get the following plot (the router icon is my default icon).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | isuru chathuranga |
| Solution 2 | A.Casanova |

