title: Graph representation in Java using linked structure
body: <p>I need to implement a graph in Java.  I cannot use the collection classes.  I can readily create a graph using an Adjacency Matrix or an Adjacency List, but I need to create a directed graph using a linked structure.  </p>
  
  <p>I might be given the adjacency matrix form:  </p>
  
  <pre><code>4           // square matrix size -- all would be square -- square only   
  0 1 1 0 
  1 1 1 1 
  1 0 0 0 
  1 1 0 1 
  </code></pre>
  
  <p>NOTE:  This is supposed to a a 4x4 matrix, but I cannot format correctly for StackOverflow.  I do not know how to enter hard return.  </p>
  
  <p>Continuing my question, I found a similar question on StackOverflow:  </p>
  
  <p><a href="https://stackoverflow.com/questions/20567609/questions-regarding-implementation-of-graph-in-c">Questions regarding Implementation of graph in c++</a> </p>
  
  <p>Where in the best accepted answer, pmr wrote:  </p>
  
  <p>1.) Yes, you can also implement it explicitly using pointers to other nodes.  </p>
  
  <p>This answer by pmr is the form of solution I need.  This is where I am having trouble.  I simply cannot picture this solution in my head.  One of the problems is how do I allow for a number of child nodes that is read from a file so that I can refer to them for a search ?  One adjacency list implementation would allow me to create an array of linked lists, but I cannot use that.  </p>
  
  <p>Is this a multi-graph ?  Is this a problem that multi-graphs solve ?  </p>
  
  <p>Alternate: I have also envisioned a tree structure with multiple child nodes per parent.  </p>
  
  <p>How would I go about implementing this in Java ?  </p>