www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CompareGraphsExample.m

    %% Compare Graphs 
% Create and plot two directed graphs, and then determine if they are
% isomorphic.
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)

%%
isisomorphic(G1,G2)