fix for sparse graph : delete edges before deleting vertex