I’m experimenting with drawing PNG images of graphs. All is well except that when I attempt to use edge weights as edge labels, all the correct weight values appear in the image, but they are on the wrong edges.
As I create the edges (iter) I create a random value for the weight, add the edge to the graph and then push the weight onto the end of a vector. This vector is then passed to the
gplot function for the
edgelabel to use.
G.weights shows the correct weights and consistently reports back the right numbers, so it is just the way that the entries are ordered in the vector supplied to the
gplot that is the issue.
Any hints? I have tried fully implementing the weights and then digging into the weights matrix for values, but same result.