Mathematical foundations of graphs are rooted in the classical graph theory. Attributed graphs with an unrestricted label alphabet are the most general way to define graphs.
Definition 1: Graph
An undirected, labeled graph G is defined as a quintuple (V,E, λ, m), where V(G) is the set of nodes, E(G) ⊆ (V×V) is the set of edges and λ: V → Lv(G ) and m: E → Le(G ) are the labeling functions for nodes and edges respectively, given the alphabets of nodes and edges, Lv(G) and Le(G). Further, two nodes u ∈V and v ∈V, connected by an edge e, is denoted as e = (u,v), if (u,v) ∈ E. For undirected graphs, (u,v) = (v,u).
Definition 2: Subgraph
A subgraph Gs of G, denoted by Gs⊆G, is a graph Gs = (Vs,Es, λs, ms), where Vs⊆ V, Es⊆ E, λs (v) = λ (v) ∀v ∈ V and ms (u,v) = m (u,v) ∀(u,v) ∈ E .
Definition 3: Subgraph Isomorphism
The subgraph Gs is said to be subgraph isomorphic to G, if there exists a bijective mapping f : Vs→V such that, ∀u ∈Vs, λs(u) = λ(f (u)) and, ∀es=(u,v) ∈Es there exist an edge e = (f (u), f (v)) ∈E such that ms(es)= m(e).
Definition 4: Occurrence of subgraph
A subgraph Gs occurs in G, if Gs is subgraph isomorphic to G, i.e. Gs⊆G.
Definition 5: frequent subgraph
Let the graph database D contain a collection of graphs G, then, the support of a subgraph Gs in D is the number of graphs G ∈ D that has a subgraph isomorphism relation with Gs. If the support exceeds a pre-defined value , Gs is a frequent subgraph in D.