Why can’t I use EdgeWeight in RandomGraph?

 Why cant I use EdgeWeight in RandomGraph?

I want to create a weighted random graph. The random graph is already created

g = BlockRandom[
  RandomGraph[BernoulliGraphDistribution[4, 0.5], DirectedEdges -> True,
    VertexLabels -> "Name"]]

but when I add EdgeWeight -> RandomReal[{-1, 1}, k]] I don’t get nothing, for any k I have used

How can I get a RandomGraph with weighted edges?

2 Answers

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange