V <- letters[1:10]
M <- 1:4
g1 <- randomGraph(V, M, .2)
z <- agopen(g1, "foo", layout=FALSE) ## default layoutType 'dot'
file <- tempfile()
agwrite(z, file)
## supported input types
graphvizCapabilities()$layoutTypes
g2 <- agread(file, layout=TRUE)
if (interactive())
plot(g2)
Run the code above in your browser using DataLab