Md. Asif Uddin

    Proposition 4I.14.P0451 of 100 in the corpus

    Message passing cannot separate what colour refinement cannot.

    A message-passing network's node states are functions of colour-refinement colours, so two graphs that refinement confuses get identical outputs. A sum aggregator reaches that limit; a mean or a max falls short of it. Passing the limit takes features the graph alone does not supply.

    Two triangles and a hexagon look the same to message passingOn the left, two separate triangles with six nodes in all. On the right, a single hexagon with six nodes. Every node in both graphs has degree two, and so does every neighbour, so all twelve nodes receive the same colour at every round of refinement. The left graph has two triangles and two components; the right has none and one.two trianglesone hexagon2 triangles, 2 components0 triangles, 1 componentEvery node: degree 2, neighbours of degree 2.Colour refinement gives all twelve the same colour,so every message-passing network returns the samemultiset of node states for the two graphs.
    Fig. 4 — Type G · Failure — Two triangles and one hexagon. Every node has degree two and neighbours of degree two, so colour refinement cannot separate the graphs, and no message-passing network can either, although one has two triangles and the other none.

    Colour refinement

    Weisfeiler and Leman’s test for graph isomorphism, in its simplest form, is a message-passing algorithm with no learning in it. Give every node the same colour. Then, round after round, recolour each node by its own colour and the multiset of its neighbours’ colours, giving a fresh colour to each distinct combination:

    cv(t+1)=hash⁡(cv(t),{ ⁣{cu(t):u∈N(v)} ⁣}).\begin{aligned} &c_v^{(t+1)}=\operatorname{hash}\big(c_v^{(t)},\\ &\qquad\{\!\{c_u^{(t)}:u\in\mathcal N(v)\}\!\}\big). \end{aligned}
    (I.14.7)

    Colour refinement is message passing with an injective update.

    The double braces mark a multiset. The hash is injective: different inputs get different colours. If at some round two graphs have different counts of some colour, they are not isomorphic. Equal counts at every round prove nothing. Shervashidze and colleagues (2011) built graph kernels on these colours.

    On the paw graph the first round separates the degrees: nodes 11 and 22 have degree 22, node 33 degree 33, node 44 degree 11. The second round looks at neighbours’ colours and changes nothing, so refinement stops with the classes {1,2}\{1,2\}, {3}\{3\} and {4}\{4\}. Nodes 11 and 22 cannot be separated by any method that ignores numbering: swapping them is a symmetry of the graph.

    The bound

    The update (I.14.7) has the same shape as message passing (I.14.2), with an injective hash in place of learned functions. That is enough to bound every message-passing network. Xu, Hu, Leskovec and Jegelka (2019) and Morris and colleagues (2019) proved it independently.

    Start every node with the same features, and suppose two nodes, in the same graph or in different graphs, have the same colour after round tt. Claim: they have the same state after layer tt. At t=0t=0 every state is equal. If two nodes share a colour at round t+1t+1, then because the hash is injective they shared a colour at round tt and had equal multisets of neighbour colours. By the claim at tt they had equal states and equal multisets of neighbour states. Their messages then form equal multisets, the aggregator returns equal values, and the update gives equal new states. So every node state is a function of its colour, and two graphs with equal colour counts produce equal multisets of node states and equal readouts. That is the first half of I.14.T4.

    Two triangles and a hexagon

    The figure shows the standard pair. Two separate triangles and one hexagon both have six nodes and six edges, and every node in both has degree two, with neighbours of degree two. Refinement gives all twelve nodes the same colour at every round. By the bound, no message-passing network with identical starting features can tell the graphs apart, whatever its weights, depth or aggregator. The check script runs three random sum networks on both and gets identical multisets of node states each time.

    Yet the graphs differ in ways a chemist would care about. The count of triangles, tr⁡(A3)/6\operatorname{tr}(\mat A^3)/6, is 22 for one and 00 for the other, and one graph is connected and the other is not. I.14.B03 works the pair through.

    Which aggregators reach the bound

    The bound used only that the network’s functions cannot separate more than the hash does. Reaching it needs the reverse: an aggregator that does not merge different multisets. A sum can be injective on bounded multisets of features from a countable set. A mean cannot: it sees only the proportions, so {1,1,2,2}\{1,1,2,2\} and {1,2}\{1,2\} both give 1.51.5. A maximum sees only which values occur, so {1,1,2}\{1,1,2\} and {1,2,2}\{1,2,2\} both give 22. With constant features, the centres of a star with two leaves and one with four receive the same mean, 11, while their sums are 22 and 44 (I.14.X03).

    Xu and colleagues built the graph isomorphism network on this observation:

    hv′=MLP⁡((1+ϵ) hv+∑u∈N(v)hu).\begin{aligned} \vec h_v'=\operatorname{MLP}\Big(&(1+\epsilon)\,\vec h_v\\ &+\sum_{u\in\mathcal N(v)}\vec h_u\Big). \end{aligned}
    (I.14.8)

    A sum and an injective update are enough to match colour refinement.

    The sum keeps the multiset, the scalar ϵ\epsilon separates a node’s own state from its neighbours’, and a multilayer perceptron can approximate the injective update that refinement uses (I.5). With these choices a message-passing network separates every pair that refinement separates, the second half of I.14.T4. The graph convolution of (I.14.5) averages, so it does not.

    Past the bound

    The bound assumes identical starting features, and the way past it is to give nodes features the graph’s symmetry does not erase. Counts of small cycles through each node separate the pair above at once. Random features separate it too, at the price of equivariance holding only in distribution. Eigenvectors of the Laplacian can serve as positions: the two graphs’ Laplacian spectra differ, since the multiplicity of the eigenvalue 00 counts connected components (I.14.X10). Each eigenvector is defined only up to sign, and a repeated eigenvalue has no preferred basis, so such positions must be used with care. Morris and colleagues also built higher-order networks that pass messages between tuples of nodes and match stronger forms of the test, at a cost that grows with the tuple size.

    Book II meets the same structure in attention, which is permutation-equivariant over the tokens of a sequence. Positional encodings are its version of the repair: features that break a symmetry the mechanism cannot break by itself.

    This chapter completes the machinery of Book I. Books II to VIII build on these fourteen chapters.

    Refine the colours

    def refine(edges, n, rounds=3):
        nbrs = [[j for i, j in edges if i == v] + [i for i, j in edges if j == v] for v in range(n)]
        colour = [0]*n
        for _ in range(rounds):
            sig = [(colour[v], tuple(sorted(colour[u] for u in nbrs[v]))) for v in range(n)]
            names = {s: k for k, s in enumerate(sorted(set(sig)))}
            colour = [names[s] for s in sig]
        return sorted(sig)
    
    two_triangles = [(0, 1), (1, 2), (2, 0), (3, 4), (4, 5), (5, 3)]
    hexagon = [(i, (i + 1) % 6) for i in range(6)]
    paw = [(0, 1), (0, 2), (1, 2), (2, 3)]
    print(refine(two_triangles, 6) == refine(hexagon, 6))
    print(refine(paw, 4))

    It prints True: the two graphs’ final colourings agree. For the paw it prints four signatures in three distinct classes, nodes 11 and 22 sharing one.

    Sources