modified adjacent graph