Update weighted_fastgreedy.R