color refinement algorithm

[[concept]]

Color refinement algorithm

The color refinement algorithm is an algorithm to assign colorings to nodes.

Given graph with node features

let (assign colors based on node feature values) let

while True:

  1. let
  • assign colors based on previously assigned colors
  1. if , break. else,

Here, is a hash function that assigns colors.

Example

Color refinement for

No node features, so assume all 1. First, Assign colors based on node features.

step :

step :

c_{1}(1) &= f(k_{1}, { k_{1} }) &= k_{1} \ c_{3}(1) &= f(k_{1}, { k_{1} }) &= k_{1} \ c_{2}(1) &= f(k_{1}, { k_{1}, k_{1} }) &= k_{2} \end{aligned}$$

Evaluate: did the colors change?

  • Yes: continue!

step :

c_{1}(2) &= f(k_{1}, { k_{1} }) &= k_{1} \ c_{3}(2) &= f(k_{1}, { k_{1} }) &= k_{1} \ c_{2}(2) &= f(k_{2}, { k_{1}, k_{1} }) &= k_{2} \end{aligned}$$

Evaluate: did the colors change?

  • No - so we are done!
  • This is the final coloring.

return

Color refinement for Again, there are no node features, so we assume the signals are all .

step : assign colors based on node features: step :

c_{1}(1) = c_{2}(1) = c_{3}(1) = f(\cdot, \{ k_{1}, k_{1} \}) = k_{1} \end{aligned}$$ `evaluate`: did the colors change? - No - so we are done - This is the final coloring `return` $\{ k_{1}, k_{1}, k_{1} \}$

Mentions

TABLE
FROM [[]]
 
FLATTEN choice(contains(artist, this.file.link), 1, "") + choice(contains(author, this.file.link), 1, "") + choice(contains(director, this.file.link), 1, "") + choice(contains(source, this.file.link), 1, "") as direct_source
 
WHERE !direct_source