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.
翻译:本文提出了若干用于有向图哈希的算法。所给出的算法不仅能对完整图进行哈希,还能为给定图中的特定节点分配哈希值。通过计算顶点轨道和图自同构群,节点对称性得以精确刻画,且对称性相同的节点将被赋予相同的哈希值。我们还提出了一种新颖的梅克尔式哈希算法,旨在遵循递归原则——节点的哈希值应仅取决于其邻接节点的哈希值。即便存在环路,该算法仍能正常工作,而朴素方法则无法实现这一点。树的结构化哈希已在区块链、源代码版本控制和网络应用中得到广泛使用。尽管树哈希备受青睐,但有向图哈希在文献中仍鲜有研究。我们的算法为哈希有向图及可归约为有向图的更复杂数据结构(如超图)开辟了新可能性。