I decided to survive with minecraft. So what should we do to survive? What items should I create?
I am running it with jupyter notebook. In addition, visualization is performed with Cytoscape.
It is explained in the figure below.
Find out which items are currently craftable and add them to the existing items. Repeat this until it converges.
Internally, it is handled by the following matrix.
・ Matrix R representing the left side of the recipe
A | B | C | D | E | F | ... | |
---|---|---|---|---|---|---|---|
Recipe 1 | 1 | 1 | 0 | 0 | 0 | 0 | |
Recipe 2 | 0 | 1 | 1 | 0 | 0 | 0 | |
... |
-Vector B representing the number of elements on the left side of the recipe
number | |
---|---|
Recipe 1 | 2 |
Recipe 2 | 2 |
... |
・ Matrix P representing the right side of the recipe
A | B | C | D | E | F | ... | |
---|---|---|---|---|---|---|---|
Recipe 1 | 0 | 0 | 0 | 1 | 0 | 0 | |
Recipe 2 | 0 | 0 | 0 | 0 | 1 | 0 | |
... |
-Matrix x representing existing items
A | B | C | D | E | F | ... | |
---|---|---|---|---|---|---|---|
Does it exist? | 1 | 1 | 0 | 0 | 0 | 0 |
The procedure is
Repeat this until it converges.
Create a database of minecraft recipes ("all recipes" in the above explanation). I quoted the recipe from minecraft wiki. I will summarize it in a csv file.
The reason why it is enclosed in "" is that it is convenient for the process of extracting a character string.
I will introduce the flow with screenshots. The main program is an implementation of the above extended network method.
Create a dictionary of items based on the imported recipe.
What do you get first when you get off in survival mode? So, this time, I chose wood (log), cobblestone, and iron ingot, which will be available relatively early (although it may not be so easy to obtain iron ingot). ...).
As mentioned above, a total of 62 items have been crafted.
Let's visualize it with Cytoscape.
Nodes with many edges extending are important items.
This time I added a diamond to the initial item.
Stick, important.
Thank you for visiting.
https://www.cell.com/fulltext/S0092-8674(17)30133-2 It describes the extended network method.
Recommended Posts