The similarity between graphs having an extremely large number of nodes, such as an SNS, a link of WWW, etc., can be obtained within a reasonable time. A unique value is provided to a
label of a node in a graph. Preferably, the value is a fixed-length bit string. In this case, the length of the bit string is selected to be sufficiently larger than the number of digits by which types of labels can be expressed. With respect to one graph, nodes of the graph are sequentially visited by an existing graph search method, such as a depth-first search, a breadth-first search, and the like. At this time, in the
system, when one specific node is visited, a calculation is performed for bit string
label values of all nodes adjacent to the specific node and the bit string
label value of the specific node, to obtain a bit
string value. The hash calculation is performed for the calculated bit
string value and the original bit string label value of the node to obtain another bit string label value, and this value becomes the label value of the node. After finishing the visit to all nodes in one graph, the label values of all nodes are rewritten. When the same treatment is performed for another graph which becomes a target of the
graph similarity comparison, label values of all nodes in this graph are rewritten. Therefore, with respect to one graph, a ratio of label values which are identical to the label values in another graph, per all nodes is calculated to obtain the similarity.