The trick was to save the list of vertices labels (one letter names) and the list of edges (two letter names) to strings. In the javascript portion of the code, I saved the literal string to a variable with a nice short name and used the length and charAt methods to access the vertex and edge names.
However, this won't generalize all that well.
I could see doing this using delimiters for longer names or even integers if I had to but it would be a complete nightmare with a list of rational numbers.