1. A computer implemented method of calculating a degree of similarity between two graphs whose nodes are respectively given discrete labels, the method comprising the steps of: sequentially tracing nodes for each of the two graphs using label values respectively to a given node and nodes adjacent thereto so that different ones of the discrete labels correspond to different ones of the label values; calculating a new label value using a label value of a currently visited node and also using label values of nodes adjacent to the currently visited node to update the label value to the currently visited node; and calculating a degree of similarity between the two graphs based on a number of the label values having been given to nodes of the two graphs and agreeing between the two graphs.