I am trying to convert my text file to an undirected graph automatically with the help of graphviz. The text file consists of the following code:
0
A
Relation
B
A
Relation
C
B
Relation
C
1
0
A
Relation
C
B
Relation
C
1
Here A, B and C are nodes. I may require a single or multiple graphs. 0 and 1 represent the start and end of each graph. The number of relations may also vary. I tried to proceed with sed, but got lost. How should I proceed to get the graph I require? Thanks for your help.
A -- C -- B
and the first would be a triangle with A, B and C in the three corners. – Naphthyl