I have tried using the option MultiedgeStyle->None
, but apparently Mathematica doesn't treat self loops in the same way it treats edges. For example, I find
GraphPlot[{{1,2},{2,0}}, SelfLoopStyle->All, MultiedgeStyle->None]
while the same command, but with twice the weight on the self loop gives
GraphPlot[{{2,2},{2,0}}, SelfLoopStyle->All, MultiedgeStyle->None]
I would like the output from both commands to be the same. I know I could write a function to replace all non-zero values on the diagonal with 1
, but I'd prefer not to for two reasons. One is that it seems as if this should be possible without resorting to that, and the other is that I'm actually using this inside another routine to draw graphs with edge weights displayed, to get output such as
where the label inside the self loop should list the correct weight, taken from the diagonal of the adjacency matrix. Removing the diagonals for later labeling then changing them in the adjacency matrix just seems like a hack.
AdjacencyMatrix[]
. It can be aDistanceMatrix[]
, aWeightedAdjacencyMatrix[]
or something else... Luckily Mathematica offers more than one way to visualise graphs - I've already encountered some problems too. $\endgroup$WeightedAdjacencyMatrix[g]
instead ofAdjacencyMatrix[g]
if I had started with some graphg
, but I'm just working directly with real symmetric matrices that represent weighted undirected graphs. Can you point me to some of those other ways to visualise graphs? I'm only familiar withGraphPlot[]
. Thanks! $\endgroup$"EdgeWeights"
to work, but it doesn't. $\endgroup$