graph assignment with calssocal approach