public void update() {
		lock.lock();
		for(Object eObj : networkTreeMap.entrySet().toArray()) {
			Entry<Byte,TreeSet<Byte>> e = (Entry<Byte,TreeSet<Byte>>)eObj;
			Byte n = e.getKey();
			if(e.getValue().isEmpty()) {
				this.removeNode(n);
			}
		}
		HashMap<Byte,LinkedList<Vertex>> paths = findAllPaths();
		nextHops.clear();
		routeLengths.clear();
		for(Entry<Byte,LinkedList<Vertex>> path : paths.entrySet()) {
			Byte id = path.getKey();
			if(path.getValue() != null) {
				Byte nextHop = Byte.parseByte(path.getValue().get(1).getId());
				nextHops.put(id,nextHop);
				routeLengths.put(id,(byte)(path.getValue().size()-2));
			} else {
				nextHops.put(id,(byte)(-1));
				routeLengths.put(id,(byte)(-1));
			}
		}
		lock.unlock();
	}