Colour refinement algorithm
In graph theory and theoretical computer science, the colour refinement algorithm also known as the naive vertex classification, or the 1-dimensional version of the Weisfeiler-Leman algorithm , is a routine used for testing whether two graphs are isomorphic.[1] While it solves graph isomorphism on almost all graphs, there are graphs such as all regular graphs that cannot be distinguished using colour refinement.
History
[edit ]The colour refinement algorithm appears in a chemistry paper in 1965[2] .
Description
[edit ]The algorithm takes as an input a graph {\displaystyle G} with {\displaystyle n} vertices. It proceeds in iterations and in each iteration produces a new colouring of the vertices. Formally a "colouring" is a function from the vertices of this graph into some set (of "colours"). In each iteration, we define a sequence of vertex colourings {\displaystyle \lambda _{i}} as follows:
- {\displaystyle \lambda _{0}} is the initial colouring. If the graph is unlabelled, the initial colouring assigns a trivial colour {\displaystyle \lambda _{0}(v)} to each vertex {\displaystyle v}. If the graph is labelled, {\displaystyle \lambda _{0}} is the label of vertex {\displaystyle v}.
- For all vertices {\displaystyle v}, we set {\displaystyle \lambda _{i+1}(v)=\left(\lambda _{i}(v),\{\{\lambda _{i}(w)\mid w{\text{ is a neighbor of }}v\}\}\right)}.
In other words, the new colour of the vertex {\displaystyle v} is the pair formed from the previous colour and the multiset of the colours of its neighbours. This algorithm keeps refining the current colouring. At some point it stabilises, i.e., {\displaystyle \lambda _{i+1}(u)=\lambda _{i+1}(v)} if and only if {\displaystyle \lambda _{i}(u)=\lambda _{i}(v)}. This final colouring is called the stable colouring.
Graph Isomorphism
[edit ]Colour refinement can be used as a subroutine for an important computational problem: graph isomorphism. In this problem we have as input two graphs {\displaystyle G,H} and our task is to determine whether they are isomorphic. Informally, this means that the two graphs are the same up to relabelling of vertices.
To test if {\displaystyle G} and {\displaystyle H} are isomorphic we could try the following. Run colour refinement on both graphs. If the stable colourings produced are different we know that the two graphs are not isomorphic. However, it could be that the same stable colouring is produced despite the two graphs not being isomorphic; see below.
Complexity
[edit ]It is easy to see that if colour refinement is given a {\displaystyle n} vertex graph as input, a stable colouring is produced after at most {\displaystyle n-1} iterations. Conversely, there exist graphs where this bound is realised.[3] This leads to a {\displaystyle O((n+m)\log n)} implementation where {\displaystyle n} is the number of vertices and {\displaystyle m} the number of edges.[4] This complexity has been proven to be optimal under reasonable assumptions.[5]
Expressivity
[edit ]We say that two graphs {\displaystyle G} and {\displaystyle H} are distinguished by colour refinement if the algorithm yields a different output on {\displaystyle G} as on {\displaystyle H}. There are simple examples of graphs that are not distinguished by colour refinement. For example, it does not distinguish a cycle of length 6 from a pair of triangles (example V.1 in [6] ). Despite this, the algorithm is very powerful in that a random graph will be identified by the algorithm asymptotically almost surely.[7] Even stronger, it has been shown that as {\displaystyle n} increases, the proportion of graphs that are not identified by colour refinement decreases exponentially in order {\displaystyle n}.[8]
Equivalent Characterizations
[edit ]For two graphs {\displaystyle G} and {\displaystyle H}, the following conditions are equivalent:
- {\displaystyle G} and {\displaystyle H} are indistinguishable by colour refinement.
- {\displaystyle G} and {\displaystyle H} are fractionally isomorphic.[9] [10]
- {\displaystyle G} and {\displaystyle H} have a common coarsest equitable partition.
- {\displaystyle G} and {\displaystyle H} have the same universal cover.[11]
- For all trees {\displaystyle T}, there are an equal number of homomorphisms from {\displaystyle T} to {\displaystyle G} as there are from {\displaystyle T} to {\displaystyle H}. [12]
- {\displaystyle G} and {\displaystyle H} cannot be distinguished by the two variable fragment of first order logic with counting.[13]
- Any message passing graph neural network will map {\displaystyle G} and {\displaystyle H} to the same output, if the input node features are the initial colours {\displaystyle \lambda _{0}}. [14] [15]
History
[edit ]References
[edit ]- ^ Grohe, Martin; Kersting, Kristian; Mladenov, Martin; Schweitzer, Pascal (2021). "Color Refinement and Its Applications". An Introduction to Lifted Probabilistic Inference. doi:10.7551/mitpress/10548.003.0023. ISBN 9780262365598. S2CID 59069015.
- ^ Morgan, H. L. (1965年05月01日). "The Generation of a Unique Machine Description for Chemical Structures-A Technique Developed at Chemical Abstracts Service" . Journal of Chemical Documentation. 5 (2): 107–113. doi:10.1021/c160017a018. ISSN 0021-9576.
- ^ Kiefer, Sandra; McKay, Brendan D. (2020年05月20日), The Iteration Number of Colour Refinement, arXiv:2005.10182
- ^ Cardon, A.; Crochemore, M. (1982年07月01日). "Partitioning a graph in O(¦A¦log2¦V¦)". Theoretical Computer Science. 19 (1): 85–98. doi:10.1016/0304-3975(82)90016-0 . ISSN 0304-3975.
- ^ Berkholz, Christoph; Bonsma, Paul; Grohe, Martin (2017年05月01日). "Tight Lower and Upper Bounds for the Complexity of Canonical Colour Refinement". Theory of Computing Systems. 60 (4): 581–614. arXiv:1509.08251 . doi:10.1007/s00224-016-9686-0 . ISSN 1433-0490. S2CID 12616856.
- ^ Grohe, Martin (2021年06月29日). "The Logic of Graph Neural Networks". 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). LICS '21. New York, NY, USA: Association for Computing Machinery. pp. 1–17. arXiv:2104.14624 . doi:10.1109/LICS52264.2021.9470677. ISBN 978-1-6654-4895-6. S2CID 233476550.
- ^ Babai, László; Erdo ̋s, Paul; Selkow, Stanley M. (August 1980). "Random Graph Isomorphism" . SIAM Journal on Computing. 9 (3): 628–635. doi:10.1137/0209047. ISSN 0097-5397.
- ^ Babai, L.; Kucera, K. (1979). "Canonical labelling of graphs in linear average time". 20th Annual Symposium on Foundations of Computer Science (SFCS 1979). pp. 39–46. doi:10.1109/SFCS.1979.8 . Retrieved 2024年01月18日.
- ^ Tinhofer, Gottfried (December 1986). "Graph isomorphism and theorems of Birkhoff type" . Computing. 36 (4): 285–300. doi:10.1007/BF02240204.
- ^ Tinhofer, Gottfried (February 1991). "A note on compact graphs" . Discrete Applied Mathematics. 30 (2–3): 253–264. doi:10.1016/0166-218X(91)90049-3.
- ^ Krebs, Andreas; Verbitsky, Oleg (2015). "Universal Covers, Color Refinement, and Two-Variable Counting Logic: Lower Bounds for the Depth". 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science. Vol. 30. pp. 689–700. doi:10.1109/LICS.2015.69. ISBN 978-1-4799-8875-4.
- ^ Dell, Holger; Grohe, Martin; Rattan, Gaurav (2018). Lovász Meets Weisfeiler and Leman. Leibniz International Proceedings in Informatics (LIPIcs). Vol. 45. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. pp. 40:1–40:14. doi:10.4230/LIPIcs.ICALP.2018.40 . ISBN 978-3-95977-076-7.
- ^ Grohe, Martin. "Finite variable logics in descriptive complexity theory." Bulletin of Symbolic Logic 4.4 (1998): 345-398.
- ^ Morris, Christopher; Ritzert, Martin; Fey, Matthias; Hamilton, William L.; Lenssen, Jan Eric; Rattan, Gaurav; Grohe, Martin (2019). "Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks". Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence and Thirty-First Innovative Applications of Artificial Intelligence Conference and Ninth AAAI Symposium on Educational Advances in Artificial Intelligence. AAAI'19. Honolulu, Hawaii, USA: AAAI Press. pp. 565–572. arXiv:1810.02244 . doi:10.1609/aaai.v33i01.33014602. ISBN 978-1-57735-809-1.
- ^ Xu, Keyulu; Hu, Weihua; Leskovec, Jure; Jegelka, Stefanie (2019). "How Powerful are Graph Neural Networks?". International Conference on Learning Representations (ICLR).