This paper presents several algorithms for hashing directed graphs. The algorithms given are capable of hashing entire graphs as well as assigning hash values to specific nodes in a given graph. The notion of node symmetry is made precise via computation of vertex orbits and the graph automorphism group, and nodes that are symmetrically identical are assigned equal hashes. We also present a novel Merkle-style hashing algorithm that seeks to fulfill the recursive principle that a hash of a node should depend only on the hash of its neighbors. This algorithm works even in the presence of cycles, which would not be possible with a naive approach. Structurally hashing trees has seen widespread use in blockchain, source code version control, and web applications. Despite the popularity of tree hashing, directed graph hashing remains unstudied in the literature. Our algorithms open new possibilities to hashing both directed graphs and more complex data structures that can be reduced to directed graphs such as hypergraphs.
翻译:本文提出了几种用于有向图哈希的算法。所给出的算法能够对整个图进行哈希,也能为给定图中的特定节点分配哈希值。通过计算顶点轨道和图自同构群,节点对称性这一概念得以精确化,且对称性相同的节点被赋予相等的哈希值。我们还提出了一种新颖的默克尔式哈希算法,该算法致力于满足递归原则:节点的哈希值应仅依赖于其邻接节点的哈希值。即便存在环,该算法也能正常运行,而朴素方法在此情况下则无法实现。树的结构性哈希已在区块链、源代码版本控制和网络应用中得到广泛使用。尽管树哈希广受欢迎,但有向图哈希在文献中仍鲜有研究。我们的算法为有向图以及可简化为有向图(如超图)的更复杂数据结构的哈希操作开辟了新的可能性。