Identifying graph-structured activation patterns in networks