def _get_graph_consistency(num_R_vertices: int, num_E_vertices: int):
    """
    Calculates the consistency of the given graph as in Definition 3.2.
    :param num_R_vertices: number of R vertices contained in a graph.
    :param num_E_vertices: number of E vertices contained in a graph.
    :return: consistency score of the graph.
    """
    return 1 - abs(num_R_vertices - num_E_vertices) / (num_R_vertices + num_E_vertices)