I'm a Python newbie since I've been coding in C++ and JAVA all along. I was implementing Dijkstra's algorithm which needed me to implement a Priority Queue/Set which stores a Tuple(a,b) where 'a' is a vertex and 'b' is the weight. I the ordering to be according to the 'b' parameter so that when i a.pop()
where 'a' is my set, the Tuple with the least weight is popped. How do I got about implementing this? All I know is:
a=set()
I have no idea how to implement the comparator with this. Any help will be appreciated