@classmethod
def from_lists(cls, vertices, edges):
    """ Generate a graph by passing in a list of vertex vals and a list of
            edges between those vertices """
    g = cls()
    for v in vertices:
        if isinstance(v, tuple) and (len(v) == 1 or len(v) == 2):
            g.add_vertex(*v)
        else:
            m = str(v) + ' must be a tuple and have length 1 or 2'
            raise ValueError(m)
    for e in edges:
        if isinstance(e, tuple) and (len(e) == 1 or len(e) == 2):
            g.add_edge(*e)
        else:
            m = str(e) + ' must be a tuple and have length 1 or 2'
            raise ValueError(m)
    return g
