function g = goodorder(G,sig) % an odering sigma induces a sequence of subgraphs % a subgraph G_i is faithful to G if for each v,u in G_i % (path from v to u in G) ==> (path from v to u in G_i) % the odering is good if each of the sigma-subgraphs is faithful to G % G is a symmetric 0-1 matrix [n,n] = size(G); for i=1:n Gi = build_subgraph(G,sig,i); g = is_faithful(G,Gi); if ~g return end end return function b = is_faithful(G,Gi) [nodesi,nodesj]=find(G); ii = find(nodesi