def get_minimum_weight(G, S, T):
    """
    Given a networkx graph G and two subsets of vertices S and T, this method returns the minimum weight of an edge e,
    having one endpoint in S and the other in T

    :param G: A networkx graph
    :param S: A subset of vertices in G
    :param T: A subset of vertices in G
    :return: The minimum weight of an edge crossing the cut (S, T)
    """

    min_weight = float('inf')
    for u in S:
        for v in T:
            if G.has_edge(u, v):
                if "weight" in G[u][v].keys():
                    min_weight = min(min_weight, G[u][v]["weight"])
                else:
                    min_weight = min(min_weight, 1)
    return min_weight