The efficiency of an AGM algorithm is further improved. For an AGM algorithm
that can efficiently extract, from a graph database including graph structured
data, graph (frequent graph) data having a support level equal to or greater than
the minimum support level, a function "relabel" for ordering the vertex labels
and edge labels of the graph is executed (step 1). Further, for a function
"Newjoin", for employing a set Fk of adjacency matrixes that represent a size k
frequent graph, for generating a set Ck+1 of adjacency matrixes, which
represent a size k+1 candidate frequent graph, a fourth condition for coupling
a first generator matrix to a second generator matrix is added to the three conditions
of the AGM algorithm only when the first generator matrix is a canonical form.