lua-users home
lua-l archive

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


> Ideally I await interface like
> 
>  local gv_graph = c_gv_graph:create()
>  gv_graph:add_edge('A', 'B')
>  gv_graph:add_edge('A', 'C')
>  gv_graph:add_edge('C', 'B')
> 
>  local gv_graph_str = gv_graph:serialize()
> 
> 
> -- Martin
> 
I assume .gv file is the representation of a graph in Graphviz „DOT“ notation:
> g=graph.open("g")
> g:edge('A','B')
> g:edge('A','C')
> g:edge('C','B')
> g:write()
digraph g {
	node [label="\N"];
	A -> B [key="edge@1"];
A -> C [key="edge@2"];
C -> B [key="edge@3"];
}
Use g:write(FILENAME) to write the graph to file FILENAME.

-- Herbert