[Minecraft] What are the important items in survival?

Introduction

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.

Extended network method

It is explained in the figure below. 6.PNG

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

  1. Take the inner product of R and x and see if it matches B In other words, make sure you have all the items you need to craft.
  2. If they match, add the P corresponding to R to x as the recipe was crafted. Add the crafted item to x.

Repeat this until it converges.

Recipe database creation

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. minecraft_reactions.PNG

The reason why it is enclosed in "" is that it is convenient for the process of extracting a character string.

Run

I will introduce the flow with screenshots. The main program is an implementation of the above extended network method.

import

0.PNG

Item dictionary creation

Create a dictionary of items based on the imported recipe. 1.PNG

Specify the initial item

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). ...).

Execution result

As mentioned above, a total of 62 items have been crafted. 7.PNG

Visualization

Let's visualize it with Cytoscape. 8.PNG

Nodes with many edges extending are important items.

This time I added a diamond to the initial item. 5.PNG

Conclusion

Stick, important.

Thank you for visiting.

References

https://www.cell.com/fulltext/S0092-8674(17)30133-2 It describes the extended network method.

Recommended Posts

[Minecraft] What are the important items in survival?
Financial Forecasting Feature Engineering: What are the features in financial forecasting?
What is "mahjong" in the Python library? ??
What are the "pipeline" and "{...}" in the Jenkins Pipeline pipeline {...} (for Groovy beginners, for experienced languages)
What is the reason why the basic commands are not displayed in Japanese in man?
Check if the characters are similar in Python
[Python] What are the two underscore (underscore) functions before?
What is wheezy in the Docker Python image?
Determining if there are birds in the image
What is the domain attribute written in Plotly's Layout?
Using the LibreOffice app in Python (1) Where are the macros?
What I learned by participating in the ISUCON10 qualifying
What does the last () in a function mean in Python?
I tried to summarize what python strong people are doing in the competition professional neighborhood
Ventilation is important. What I did to keep track of the C02 concentration in the room