// code template for BFS

		State start = /*start*/;
		vector<State> Q( 1, start );
		set<State>    V; V.insert(start);

		for(int step=0; !Q.empty(); ++step)
		{
			vector<State> Qold; Qold.swap(Q);
			for(int qi=0; qi<Qold.size(); ++qi)
			{
				State& cur = Qold[qi];
				if( /*isGoal(cur)*/ )
				{
				}

				foreach(next)
				{
					if( !V.count(next) )
					{
						V.insert(next);
						Q.push_back(next);
					}
				}
			}
		}
