removing weighted graph concept