I'm using R to generate a DAG (Directed Acyclic graph). With the following code I generate an Erdős–Rényi graph.
library(igraph)
aph <- erdos.renyi.game(12, 0.1, type=c("gnp", "gnm"),
directed = TRUE, loops = FALSE)
The problem is that even it says that
directed = TRUE ,`loops = FALSE`
the code is still generating loops and the graphs are not directed.
In image 1 the vertex 2
and 11
contains an bidirectional edge.
Also in image 2 there is a loop from nodes 6
, 9
and 7
.
How can I solve this problem and generate a correct DAG?