def _vertex_lies_in(G, v, R):
    """
    Checks if vertex v lies in region R
    :param G: NetworkX Graph instance
    :param v: any vertex in the Graph
    :param R: list of co-ordinates (nelat, nelong, swlat, swlong)
    :return: True if v lies in R, else False
    """
    if 'spatial' in G.node[v]:
        lat = G.node[v]['spatial']['lat']
        lng = G.node[v]['spatial']['lng']
        return R[2] <= lat <= R[0] and R[3] <= lng <= R[1]
    return False