Search:

Type: Posts; User: copeg

Search: Search took 0.17 seconds.

  1. Replies
    7
    Views
    5,663

    Re: Issue Building Graph in Adjacency Matrix

    Yes

    Yes...you can create an Array or ArrayList of size with*height, initializing all its values to null. Then instead of 'adding' the Vertex to the array, you set the Vertex value in the array...
  2. Replies
    7
    Views
    5,663

    Re: Issue Building Graph in Adjacency Matrix

    First, the methods of Graph will throw a NullPointerException (caught in the addVertex method) - take a look at the scope of the variables in the constructor. Second, based upon what you have posted...
  3. Replies
    7
    Views
    5,663

    Re: Issue Building Graph in Adjacency Matrix

    Not fully sure how you are storing your vertices (don't have time to look at the attachment), but I'd presume your graph has a method to retrieve a vertex at a particular position? Something like

    ...
Results 1 to 3 of 3