public State path(Node f, Node t, Queue<State> q, int len) {
		HashSet<Node> v = new HashSet<Node>();
		q.offer(new State(f));
		while (!q.isEmpty()) {
			State cur = q.poll();
			if (!v.contains(cur.node)) {
				v.add(cur.node);
				if (cur.node.compareTo(t) == 0) return cur;
				for (Node n: edges.get(cur.node).keySet())
					if (!v.contains(n) && (len <= 0 || cur.len < len)) q.offer(new State(cur, n));
			}
		}
		return null;
	}