%% Compute Isomorphism Permutation
% Create and plot two directed graphs, and then calculate the isomorphism relation between them.

G1 = digraph([1 1 1 2 3 4],[2 3 4 4 4 1]);
G2 = digraph([3 3 3 2 1 4],[1 4 2 3 2 2]);
subplot(1,2,1)
plot(G1)
subplot(1,2,2)
plot(G2)

%

p = isomorphism(G1,G2)

% The result indicates that reordernodes(G2,p) has the same structure as G1.
% Copyright 2012 The MathWorks, Inc.