有人可以给我一个在 MATLAB 中工作的 Ullman 的图同构问题实现,或链接到它。或者,如果您至少有 C 语言,那么我会尝试在 MATLAB 中实现它。
谢谢
有人可以给我一个在 MATLAB 中工作的 Ullman 的图同构问题实现,或链接到它。或者,如果您至少有 C 语言,那么我会尝试在 MATLAB 中实现它。
谢谢
我也在寻找它。我一直在网上寻找,但到目前为止没有运气,但我发现了这个: Algorithm,其中解释了算法。
另一方面,我发现了这个:
def search(graph,subgraph,assignments,possible_assignments):
update_possible_assignments(graph,subgraph,possible_assignments)
i=len(assignments)
# Make sure that every edge between assigned vertices in the subgraph is also an
# edge in the graph.
for edge in subgraph.edges:
if edge.first<i and edge.second<i:
if not graph.has_edge(assignments[edge.first],assignments[edge.second]):
return False
# If all the vertices in the subgraph are assigned, then we are done.
if i==subgraph.n_vertices:
return True
for j in possible_assignments[i]:
if j not in assignments:
assignments.append(j)
# Create a new set of possible assignments, where graph node j is the only
# possibility for the assignment of subgraph node i.
new_possible_assignments = deep_copy(possible_assignments)
new_possible_assignments[i] = [j]
if search(graph,subgraph,assignments,new_possible_assignments):
return True
assignments.pop()
possible_assignments[i].remove(j)
update_possible_assignments(graph,subgraph,possible_assignments)
def find_isomporhism(graph,subgraph):
assignments=[]
possible_assignments = [[True]*graph.n_vertices for i in range(subgraph.n_vertices)]
if search(graph,subgraph,asignments,possible_assignments):
return assignments
return None
这里:实施。我没有将其转换为 Matlab 的技能,如果你有它们,如果你能在完成后分享你的代码,我将不胜感激。