def graphTrain(graph, id_list):
    """
    construct graph from training set

    Args:
        graph: networkx type graph
        id_list: IDs of training set
    
    Returns:
        graph constucted from training set
    """
    graph_train = graph.subgraph(id_list)
    return graph_train