Skip to content

Instantly share code, notes, and snippets.

@pedroj
Created February 20, 2012 22:59
Show Gist options
  • Select an option

  • Save pedroj/1872120 to your computer and use it in GitHub Desktop.

Select an option

Save pedroj/1872120 to your computer and use it in GitHub Desktop.
Comparing two networks
# For larger graphs calculate the intersection
# of the two graphs, this is reasonably fast, and then
# the Hamming distance is the number of edges in the
# symmetric difference. (If i'm right...)
int <- graph.intersection(g1,g2)
ecount(g1)+ecount(g2)-2*ecount(int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment