Input: Given graph $G=(V,E)$ vertex labeling in some order
Output: Change the labeling of vertices's such that labeling start $v_1$ as $u_1$, next label the neighbors of $v_1$ as $u_2,u_3,u_4,...$ according least index given in input. Next labeling the neighbors of least index neighbor of $v_1$. I.e. $v_1=u_1$ and neighbors of $v_1$ as $u_2,u_3,...$. so .. on
For example: input: $G=(V,E)$ and $V=\{v_1,v_2,v_3,v_4,v_4,v_5,v_6\}, E=\{v_1v_3,v_1v_5,v_1v_6,v_2v_3,v_2v_4,v_2v_5,v_2v_6\}$
Output: $G'=(U,E')$ and $U=\{u_1,u_2,u_3,u_4,u_4,u_5,u_6\}, E'=\{u_1u_2,u_1u_3,u_1u_4,u_2u_5,u_3u_5,u_4u_5,u_5u_6\}$
Can there be a algorithm for above process in logspace? I trying with BFS but not working in logspace. Can any one help me out.
See for defination of Lexicographic BFS(en.wikipedia.org/wiki/Lexicographic_breadth-first_search)