Convert Algorithms on Graphs graph format into dot format
cat input.txt | node todot.js
cat input.txt | node todot.js | dot -Tpng | imgcat
Requires graphviz
& beta version of iTerm2.
First line contains number of vertices and number of edges. Subsequent lines define edges between vertices.
5 6
1 2
2 3
3 4
1 4
1 5
5 4
digraph {
1 -> 2
2 -> 3
3 -> 4
1 -> 4
1 -> 5
5 -> 4
}
OSC