Comparing two graph structures with the same number of vertices and edges to see if they are equivalent would be the [graph isomorphism problem](http://en.wikipedia.org/wiki/Graph_isomorphism_problem).  The graph isomorphism problem is known to be **NP** in complexity, but it is not known if it is NP-complete nor is it known to be solvable in polynomial time.

Comparing two graph structures with different numbers of edges and vertices would be a slightly bigger problem.  Call the graph with the smaller number of vertices $G_1$ and the graph with the larger number of vertices $G_2$.  Now you have to search to see if $G_1$ is isomorphic to a subset of $G_2$.  Depending on the relative sizes of the graphs, this could take a long time to evaluate.


If you already has a *similarity metric* defined for two graphs with the same number of vertices, e.g. $d(G_a,G_b)$, where $|V_a|=|V_b|$, then you could proceed as follows.

One way to attack the problem is to take the smaller graph as the template and see if you can overlay it onto the larger graph by taking a subset of the vertices of $G_2$, call it $H_n$ where $n$ can be one of the $\binom{|V_2|}{|V_1|}$ ways of picking a subgraph of $G_2$ with the same number of vertices as $G_1$.  $|V_1|$= the number of vertices in $G_1$, and $|V_2|$= the number of vertices in $G_2$ in this case.