def maxcut_obj(x,G):
    """
    Given a length n bit string x and graph G, calculate max-cut objective and outputs the cut
    size for that string.

    Parameters
    ----------
    x : string
        A length n bit string.
        
    G : networkx graph object
        Represents the graph that we are doing max cut on

    Returns
    -------
    cut : int
        The value of the cut for the given string
    """
    cut = 0
    for i, j in G.edges():
        if x[i] != x[j]:
            cut -= 1
    return cut