Edit distance between two graphs

旧街凉风 提交于 2019-12-02 20:35:37

I think graph edit distance is the measure that you were looking for.

Graph edit distance measures the minimum number of graph edit operations to transform one graph to another, and the allowed graph edit operations includes:

  • Insert/delete an isolated vertex
  • Insert/delete an edge
  • Change the label of a vertex/edge (if labeled graphs)

However, computing the graph edit distance between two graphs is NP-hard. The most efficient algorithm for computing this is an A*-based algorithm, and there are other sub-optimal algorithms.

You should look at the paper A survey of graph edit distance

For a general graph it is a NP-complete problem as others mentioned in their answer. But for tree graph there are well known polynomial algorithms. May be most famous of them is "Zhang Shasha" algorithm which was published in 1989.

Note:

The Levenshtein distance (or edit distance) is between two strings

But in Graph you should search between at least N! position that you find Identity of each edge and vertex. You can compare between two graph by unique index easily,But The master question is define identity for each vertex and edge.this question (find identity for each vertex and edge in two graph that they can to transform ) is very hard and was called isomorphism problem (NP-Complete). You can search about isomorphism graph.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!