graphs are splitted by layers