title: Three ways to store a graph in memory, advantages and disadvantages
body: <p>There are three ways to store a graph in memory:</p>
  
  <ol>
  <li>Nodes as objects and edges as pointers</li>
  <li>A matrix containing all edge weights between numbered node x and node y</li>
  <li>A list of edges between numbered nodes</li>
  </ol>
  
  <p>I know how to write all three, but I'm not sure I've thought of all of the advantages and disadvantages of each.</p>
  
  <p>What are the advantages and disadvantages of each of these ways of storing a graph in memory?</p>