Plotting graph using edge list

You can do something like this :
edges_to_label = Dict(Edge(1,3) => "a", Edge(3,2) => "b", Edge(1,2) => "c")
display(gplot(g, nodelabel = 1:3, edgelabel = [edges_to_label[e] for e in edges(g)]))

SimpleGraph only supports a unit range for the index of vertices, if you want to use your own labeling, you should use a MetaGraphs. (You can also have a look at MetaGraphsNext which is still experimental but should be more performant)

1 Like