/* Prints state expansions at time t for a FSA. Starts with 1 token in state 0. maxtime 4 5 (means and edge from 4 to 5) 3 6 -1 Generates the FSA database. FILENAME= nodes.edges.number File stores: The first 30 terms of the sequence. -1 The FSM in edge format //This is tested for graph isomormphism to disallow multiple entries -1 hyperlinks to files with the same sequence Updates MasterFile: A list of all files sorted in "alphabetical" order of their sequences. Traversal Algorithm: 0 0 0 1 1 0 1 1 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 ... Lists all posible edges. Takes all subsets, with at least one in degree on every vertex except 0. -Check for connectivity -Check for isomorphism -sequence isomorphism -nodes and edges isomorphism -permute edges to see if isomorphic -Adds to database if not isomorphic */ #include #include #define MAX_EDGES 10000 #define MAX_STATES 100 int states[MAX_STATES][MAX_EDGES]; int edges[MAX_STATES]; mpz_t SUMS[MAX_STATES]; mpz_t NEW_SUMS[MAX_STATES]; mpz_t SUM; int maxTime; int stateNum; int pairs[10000][2]; int choices[10000]; int pairNum=1; int CUR_EDGES=1; int CUR_VERTS=1; int dfsFindNext() { int i,j,k; } getNextSequence() { int i,j,k; if(CUR_EDGES*CUR_VERTS==pairNum) { CUR_VERTS++; pairNum=CUR_VERTS*CUR_VERTS; CUR_EDGES=CUR_VERTS-1; for(i=0;i=stateNum) stateNum=j+1; if(k>=stateNum) stateNum=k+1; states[j][edges[j]]=k; edges[j]++; } gmp_printf("1\n"); for(i=0;i