Define an iter method so that each call to next produces a value that is a 2-tuple repesenting an edge in the Graph: an origin node followed by one of its destination nodes. The origin nodes are produced in increasing order of their degree (how many edges, both incoming and outgoing, they have). And, if two nodes have the same degree, they should be produced in alphabetical order. The destination nodes for each origin node should appear in alphabetical order.
For example, iterating over the original Graph above produces 6 values in the following order: ('b', 'c'), ('b', 'd'), ('a', 'c'), ('a', 'd'), ('d', 'a'), and ('d', 'c'). This is the ordering, because node b has degree 2, so it and its two destination nodes, appearing alphabetically, are first; node a has degree 3, so it and its two destination nodes, appearing alphabetically, are next; and finally node d has degree 4, so it and its two destination nodes, appearing alphabetically, are last.