let add_elem g key =
    let elem = Node.make key in
    add_vertex g elem;
    elem