I want to create a random graph with SpatialDegreeDistribution and want the edges to be directed.

T = SpatialGraphDistribution[10, 0.3, DistanceFunction -> EuclideanDistance]
g = RandomGraph[T, VertexLabels -> Automatic, DirectedEdges -> True]

The visual graph generated here is without any directed edges and it is confirmed to be undirected by the output of DirectedGraphQ[g] being False. However, if I use DegreeGraphDistribution then there is no issue generating directed random graphs.

What am I missing here? Why doesn't the directive DirectedEdges work?

Edit :

Implementing DirectedGraph[g] solves the issue by generating directed edges but still doesn't explain why DirectedEdges fails to work at the initial construction.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.