comparing Graphs and Comparing Matrix

Hi Guys,

I have made a program which builds 3 arc and node graphs.

The first graph is the Ideal Graph which the other two are going to be compared to. I was wandering if there is a way of comparing similarity between two graphs ie How many of the vertices in graph 2 are similar to the vertices in graph 1.

Alternative question:

The graphs were drawn using a 2D array of 1 and 0 so if there is a way of comparing the 2D array for Graph 1 with the array for graph 2 instead than this would solve my problem.

Just to make it a bit more clear:

I have two 2Dimensional arrays like so

double [][] MatrixOfOriginalGraph= {{1,1,1,1},

{0,1,0,0},

{0,0,1,0},

{0,0,0,1}};

double [][] MatrixToBeComparedWithOriginal= {{1,0,0,1},

{0,1,1,0},

{0,0,1,1},

{0,0,0,1};

The first array is used to draw the first graph and the second is used to draw the second graph. The first graph is basically a 4 node graph where the first node is connected to all the other nodes. The other nodes are not connected to each other. The second graph is mixed. I want to know how many of the nodes in vertices in graph two are the same as the ones in graph 1.

Any help is appreciated greatly at this time when the deadline panic is kicking in.

Thanks,

jetnori.