Memory efficient way to represent shortest path?
问题 Say I am given the shortest path from node A to node B. The path is simply a list of edges, so a path A->B->C, will be represented as [(A,B),(B,C)]. Currently, each node is of type string , a path from one node to another, say (A, B), is a set of string, and the path is a list of sets. Now, the path consists of over 60k edges, and it must be saved to a database for later retrieval. So obviously, I need a very nice way to represent this path in C++ such that: the size of the path is