title: Sorting values C++ map data structure with many values for a key
body: <p>This is the format of a line my input file:</p>
  
  <p>Population|City|State|ListOfHighways ==></p>
  
  <p><code>6|Oklahoma City|Oklahoma|I-35;I-44;I-40
  6|Boston|Massachusetts|I-90;I-93
  8|Columbus|Ohio|I-70;I-71</code></p>
  
  <p>I need to create an output file with this following format:</p>
  
  <p><code>Population
  (newline)
  City, State
  Interstates: Comma-separated list of interstates, sorted by interstate number ascending
  (newline)</code></p>
  
  <p>==> Example:</p>
  
  <pre><code>6
  
  Boston, Massachusetts
  Interstates: I-90, I-93
  
  Oklahoma City, Oklahoma
  Interstates: I-35, I-40, I-44
  
  8
  
  Columbus, Ohio
  Interstates: I-70, I-71
  </code></pre>
  
  <p>Here, the states having the same population should be grouped together and they have to be sorted alphabetically by state first and then by cities. I was able to get the format right, but I am not able to figure out which data structure to use to sort the states and then the cities. </p>
  
  <p>I have <code>map&lt;int, vector&lt;string&gt; &gt;</code> now. key is the population and the rest is the vector. Any suggestions are welcome.</p>