"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Summary\n",
"\n",
"This notebook showed how to find the highest-scoring honeycomb. Four ideas led to four approaches:\n",
"\n",
"1. **Brute Force Enumeration**: Compute the game score for every possible honeycomb; return the best.\n",
"2. **Pangram Lettersets**: Compute the game score for just the honeycombs that are pangram lettersets (with all possible centers).\n",
"3. **Points Table**: Precompute the score for each letterset; then for each candidate honeycomb, sum the scores of the 64 letter subsets.\n",
"4. **Branch and Bound**: Try all 7 centers only for lettersets that score better than the best score so far.\n",
"\n",
"These ideas led to a substantial reduction in the number of honeycombs examined (a factor of 400), the run time of a call to `game_score` (a factor of 300), and the overall run time of `best_honeycomb` (a factor of 75,000, although I didn't actually run the first two cases, just estimated the time).\n",
"\n",
"|Approach|Honeycombs|`game_score` Time|Total Run Time|\n",
"|--------|----------|--------|----|\n",
"|**1. Brute Force Enumeration**|3,364,900|9000 microseconds|8.5 hours|\n",
"|**2. Pangram Lettersets**|55,902|9000 microseconds|500 seconds|\n",
"|**3. Points Table**|55,902|26 microseconds|1.6 seconds|\n",
"|**4. Branch and Bound**|8,084 |26 microseconds|0.4 seconds|\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}