Let suppose we order the nodes first by degree (in + out), to get a list of node structures:
Node: labels:  # lexicographic ordered out_arrows:  # ordered by ordering of the nodes in_arrows:  # ordered by ordering of the nodes
Then how should we order the nodes that have equal degree? Or am I approaching this the wrong way? My end goal is to have O(Q) to O(log N) graph lookup where N is the size of my library and Q is the size of a much smaller query graph. Not only that but once you convert the serialized data to a hashable type such as a string, then you can perform the search using a standard data structure (dictionary or map).
What is some work done in this area, i.e. have people already thought of this standard form serialization and search method?
Note that the key graphs my library will hold are relatively small (5-50) nodes, but their may be a million of them in the library. So it's not advised to perform a usual subgraph isomorphism search of the whole library say using Ullmann's algorithm, because for the most part, the graph is disconnected.