def __add_node(g, label, id):
    """
    Adds a node with the given label and id.

    :param g: the graph
    :param label: the label
    :param id: the unique id
    :return: the node index
    """
    i = len(g.nodes())
    g.add_node(i, label = label, id = id)
    return i