Consider this graph, that I downloaded from the OpenConnectome project.
Graph[EdgeList[cElegans], DirectedEdges -> False] // DirectedGraphQ
outputs: True
.
Which makes no sense to me. Is there any logic to this or is this a Mathematica bug?
PS: The same thing happens with SetProperty[Graph[EdgeList[cElegans]], DirectedEdges -> False] // DirectedGraphQ
edit: The original question was missing the call to EdgeList
. Sorry for the mistake.
g = Graph[{1 -> 2, 2 -> 3, 3 -> 1}, DirectedEdges -> False]; DirectedGraphQ[g]
yieldsFalse
as doesg //DirectedGraphQ
. $\endgroup$ – David G. Stork Mar 30 '16 at 0:30imp = Import["http://awesome.cs.jhu.edu/data/static/graphs/worm/c.elegans_neural.male_1.graphml"]; g=Graph[EdgeList[imp][[;;5]],DirectedEdges->False];DirectedGraphQ[g]
givesTrue
. $\endgroup$ – kglr Mar 30 '16 at 0:38Graph[UndirectedEdge@@@EdgeList[imp]]
$\endgroup$ – kglr Mar 30 '16 at 0:49Graph[EdgeList[cElegans]/. DirectedEdge->UndirectedEdge]
. $\endgroup$ – kglr Mar 30 '16 at 1:03