User Tools

Site Tools


weave_method

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
weave_method [2023/05/15 15:56]
harshec
weave_method [2023/05/15 16:33] (current)
harshec
Line 7: Line 7:
 ===Psuedo Code=== ===Psuedo Code===
  
-<code>depthS(string str, int n, int s, int lastinsert) update_fairness_calc(lastinsert) if(!fair()) return +    depthS(string str, int n, int s, int lastinsert) update_fairness_calc(lastinsert) if(!fair()) return 
- +    if(s == MAX_S) 
-if(s == MAX_S) +        depthN(str, n) 
-    depthN(str, n) +    for(i = lastinsert; i <= MAX_S * (n-1); ++i) 
- +        depthS(str.insert('a' + n - 1, i), n, s + 1, i) 
-for(i = lastinsert; i <= MAX_S * (n-1); ++i) +    depthN(string str, int n) if(n == MAX_N) print("solution = " + n) return calculate_worth_of_all_insertion_points(str) depth(str, n + 1, 0, 0) 
-    depthS(str.insert('a' + n - 1, i), n, s + 1, i) +    main() depthN("", 0)
- +
-depthN(string str, int n) if(n == MAX_N) print("solution = " + n) return calculate_worth_of_all_insertion_points(str) depth(str, n + 1, 0, 0) +
- +
-main() depthN("", 0)</code.+
  
 ===Future Work=== ===Future Work===
Line 23: Line 19:
 Here's an outline of the basic idea of the simple version. 1. First build a list of all n=2 solutions. 1. When going from a n=2 set to a n=3 set, ALL n=2 subsets of the n=3 set must be part of the list generated in step 1. Keep a list of all n=2 subsets of the n=3 solutions. 1. Again, when going from a n=3 set to a n=4 set, all n=2 subsets of the n=4 set must be part of the list generated step 2. Here's an outline of the basic idea of the simple version. 1. First build a list of all n=2 solutions. 1. When going from a n=2 set to a n=3 set, ALL n=2 subsets of the n=3 set must be part of the list generated in step 1. Keep a list of all n=2 subsets of the n=3 solutions. 1. Again, when going from a n=3 set to a n=4 set, all n=2 subsets of the n=4 set must be part of the list generated step 2.
  
-But we can do even better. There are 3 different n=2 subsets in all n=3 sets, ba, ca, and cb. We can keep separate lists for all n=2 subsets. When building n=4 sets, we use their n=3 subsets and again filter based on the more specific 3 different n=2 lists. For example, the db relationship in dcba is part of 2 n=3 subsets, dcb and dba. In those subsets, db is equivalent to ca and cb in cba. Full relationship chart listed below. http://landonkryger.com/rubik/dice/flowchart.png+But we can do even better. There are 3 different n=2 subsets in all n=3 sets, ba, ca, and cb. We can keep separate lists for all n=2 subsets. When building n=4 sets, we use their n=3 subsets and again filter based on the more specific 3 different n=2 lists. For example, the db relationship in dcba is part of 2 n=3 subsets, dcb and dba. In those subsets, db is equivalent to ca and cb in cba. Full relationship chart listed below. 
 + 
 +{{http://landonkryger.com/rubik/dice/flowchart.png}}
  
 Lists of n=2 subset counts are available on the wiki page Results. Lists of n=2 subset counts are available on the wiki page Results.
weave_method.1684166181.txt.gz · Last modified: 2023/05/15 15:56 by harshec