def query_vertices(driver, min_degree):
    """
    Find all vertices with a minimum degree
    """
    query = f"MATCH (m1:Member)-[:Friend]->(m2:Member) WITH m1, count(m2) as degree, collect(m2) as friends WHERE degree >= {min_degree} RETURN m1, friends"
    with driver.session() as session:
        result = list(session.read_transaction(lambda tx: tx.run(query)))

    friends = {}
    for record in result:
        member, member_friends = record
        name = member["name"]
        friends[name] = list(map(lambda x: x["name"], member_friends))

    return friends