This seems like it would be fairly simple, but I've been unable to find anything about how to do this on the web. I'm writing the steps for Kruskal's algorithm. I need to create a list of edges sorted by weight, with labels above the weight referencing the edges, something like this:
a-b b-c c-e
1 3 5 ...
Design and Analysis of Algorithms by Anany Levitin uses similar formatting on p. 316. If there are no other options, I suppose verbatim might work, though I was hoping to make it look a little nicer. Any recommendations?