-1

誰かが、MATLAB で動作するウルマンのグラフ同型問題の実装を教えてくれるか、リンクしてくれませんか。または、少なくとも C を使用している場合は、MATLAB で実装しようと思います。

ありがとう

4

1 に答える 1

0

私もそれを探しています。私はウェブを探していましたが、これまでのところ運がありませんでしたが、これを見つけました: 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 に変換するスキルがありません。もしあれば、完了したらコードを共有していただければ幸いです。

于 2015-01-27T23:48:37.073 に答える