3
$\begingroup$

Is there any way to calculate similarity of graphs or the graph edit distance in Mathematica ?

$\endgroup$

1 Answer 1

4
$\begingroup$
g1 = RandomGraph[{30, 50}];
g2 = RandomGraph[{30, 45}];
EditDistance[EdgeList[g1], EdgeList[g2]]

(* 49 *)

$\endgroup$
1
  • $\begingroup$ This is not the same as graph edit distance. For example, it won't be zero for isomorphic graphs. $\endgroup$
    – Jim Conant
    Commented Aug 23, 2022 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.