counterexample for this graph isomorphism algorithm
I've not looked closely at your algorithm so I'm not sure exactly what it does. However, it sounds quite a lot like colour refinement (also known as the 1-dimensional Weisfeiler-Lehman method). I suggest you look at the following paper, which will both explain that method and show a class of graphs whose isomorphism problem it cannot solve, even though graph isomorphism on those specific graphs is in&nbsp;P.  Even if your algorithm turns out to be different from colour refinement, a similar construction might give some graphs it doesn't work on.


J.-Y. Cai, M. F&uuml;rer and N. Immerman, An Optimal Lower Bound on the Number of Variables for Graph Identification.  Combinatorica, 12(4):389&ndash;410, 1992. (Free PDF)


By the way, one thing you can (probably) do to avoid the labels your algorithm assigns from becoming exponentially long is to just replace them with 1, 2, ... at each round.  You (probably) don't need to know exactly what label each vertex has; rather, you (probably) just need to know whether two vertices have the same label or not.