#SetP is still bugged! print(`SetP has bugs!`): #read `W:\\CLIQUE.txt`: Help:=proc(): print(`CompG(V), Score(G,P), SetP(S,k)`):end: #CompG(V): Given a set V of vertices outputs #the complete graph on V CompG:=proc(V) local i,j: [V, {seq(seq({V[i],V[j]},j=1..i-1),i=2..nops(V))}]: end: #Score(G,P): Inputs a simple graph G=[V,E] #and a set partition P of V outputs its score Score:=proc(G,P) local i,G1,E,E1: G1:=[ {seq( op(P[i]),i=1..nops(P))}, {seq( op(CompG(P[i])[2]),i=1..nops(P))} ]: if G[1]<>G1[1] then ERROR(`Bad input`): fi: E:=G[2]: E1:=G1[2]: nops(E minus E1) + nops(E1 minus E) : end: #SetP(S,k): the set of set-partitions of a set S #into k non-empty subsets SetP:=proc(S,k) local i,S1,RandG,SP1,SP2: #needs more work if k=0 then RETURN({}): fi: if nops(S)