Created compare generator for priorityqueue and implemented greedy search