with(GraphTheory): with(StringTools): strongprod := proc (G) return GraphUnion(CartesianProduct(G, G), TensorProduct(G, G)) end proc: compv := proc (vert) with(StringTools); return parse(Take(Select(IsDigit, vert), 1)), parse(Drop(Select(IsDigit, vert), 1)) end proc: NeighborsV := proc (G, vert) local u, v; u, v := compv(vert); return `union(`union`({Neighbors(G, u)[]}, {Neighbors(G, v)[]}):, {u,v}):end proc: GraphList := ImportGraph("/home/lbaird/Desktop/graph6c.g6", "graph6", output = list): for U in GraphList do\ gcount:=gcount+1:\ G:=strongprod(U):\ for i in Vertices(G) do f(i):={Vertices(U)[]}\NeighborsV(U,i);\ end do: changed:=true: while changed do\ g:=copy(f):\ for edge in Edges(G) do\ u,v:=edge[]:\ u1,u2=compv(u):\ v1,v2=compv(v):\ f(u):= `intersect`(f(u), NeighborsV(U,v)):\ f(v):=`intersect`(f(v),Neighbors(U,u)):\ end do:\ changed:=false:\ for i in Vertices(G)do if f(i)<>g(i) then\ changed:=true:\ end if;\ if nops(f(i))=0 then\ twocopwin:=true:\ changed:=false:\ break;\ end if:\ end do:\ end do:\ if twocopwin then cwc:=cwc+1: end if:\ end do: cwc;gcount;