def changeTriangleT3(G, A, i):
    """
    Change statistic for partner-partner attribute triangle (T3)

      *
     / \
    *---*
    """
    delta = 0
    if G.degree(i) < 2:
        return 0
    else:
        for u in G.neighbourIterator(i):
            if A[u] == 1:
                for v in G.neighbourIterator(u):
                    if v != i and A[v] == 1 and G.isEdge(i, v):
                        delta += 1
    assert delta % 2 == 0
    return delta / 2.0