update with graph theory