function [Out iso] = IsomorphismChecker(A1, A2) %[Out iso] = IsomorphismChecker(A1, A2) %Inputs: Adjacentcy matrices A1, A2 of two simple graphs w/ %same number of vertices %Outputs: Out = 1 if graphs are isomorphic, = 0 if not %iso = perm of vertices that give isomorphism if one exists, %if not iso = 0 [n m] = size(A1); %n = number of vertices Perms = perms(1:n); [r c] = size(Perms); %r = number of permutations of vertices for i = 1:r perm = Perms(i,:); M= A1(perm, perm); if sum(sum(M==A2))== n^2 Out = 1; iso = perm; return end end Out = 0; iso = 0;