add key function: eulerize the graph