Your "Graph" is a dictionary, dictionaries in Python are unordered, if you want to use an ordered dictionary, you can import it from the collections
module.
from collections import OrderedDict
graph = OrderedDict({'A': ['B', 10, 'B', 10, 'B', 10, 'C', 15], 'C': [1001, 'OUT'], 'B': [1000, 'IN', 1000, 'IN']})
Proof that it is ordered:
>>> for key, value in graph.items():
print key, value
A ['B', 10, 'B', 10, 'B', 10, 'C', 15]
C [1001, 'OUT']
B [1000, 'IN', 1000, 'IN']
Notice, that since your initial code has the keys in the order "A, C, B" that is the order they will stay in with the OrderedDict.