Genius of the Rules-Style System
Chapter 73 The Key to Algorithm Design
When designing an algorithm to crack a third-order Rubik's Cube, two things must be clarified first.
One is input data.
The input data is the nine grid colors corresponding to the six faces of the three-dimensional Rubik's Cube. The characteristic of the data is that there are six colors, and each color totals nine. In addition, the color corresponding to the middle of the six faces is fixed. .
The second is to output data, which is the purpose of calculation, to obtain the minimum steps required to restore the Rubik's Cube.
As long as this condition can be met, other desired data, such as the process of achieving the lowest steps, are just simple records made during the program operation process.
After clarifying the input and output data, the front and rear frameworks are almost ready.
This is similar to the algorithm package sent by Zhang Zhen, except that the difficulty level has been increased dozens, hundreds, or even higher.
Next, the design begins.
Modeling.
Modeling is to turn real-life problems into mathematical problems, using mathematical formulas and codes to express the relationship between the various small grids of the Rubik's Cube, as well as the possible transformation methods.
This process works two ways.
One is to use the spatial position as the base point, that is, the position is fixed, and the color will change; the other is to use the fixed color small grid as the base point to form a position transformation.
After choosing a modeling method, enter the actual design process.
Zhao Yi had just started thinking when he encountered a huge problem: How to determine a twist that would make the devil move closer to the direction of restoration instead of making it more chaotic?
This is a super hard problem.
Solving this problem is almost equivalent to completing the algorithm.
Therefore, this road is blocked.
Think again.
Then think about it from another angle. You can look for the faces with the most same colors and use this as a basis to achieve the restoration. Just like most people's choice, restore one face of the third-order Rubik's Cube first, and the other faces will become much easier.
However, science is rigorous.
How to prove that starting from the faces with the most identical colors will restore the fastest?
How to prove that restoring one face first is the fastest?
As soon as Zhao Yi started designing the program, he encountered a lot of problems. He took a deep breath and his logical thinking ended here.
Next is cause and effect thinking time.
Zhao Yi understood the difficulty of algorithm design. He opened the system interface and simply used a scientific research coin.
[Research Coin: 15. 】
[Use research coins to improve causal thinking. 】
[Scientific Research Coin-1, assists in improving causal thinking ability and obtains inspiration effect. Duration: sixty minutes. 】
moment.
The mindset has changed.
Zhao Yi stared at the computer screen again, and his mind jumped. Instead of struggling with the difficult problem that came to mind, he jumped to the data analysis of inputting the Rubik's Cube.
For example, based on the center color of each face, the minimum number of steps required to convert small grids of the same color on other faces to the corresponding center face.
For example, how many grids are next to grids of the same color and their specific locations must be recorded in detail.
etc.
After consuming scientific research coins to improve his causal thinking mode, the use of "Law of Causality" and "Law of Contact" became subconscious. He kept thinking, tapping with his fingers, and put what he thought into Convert to code on keyboard.
write.
Write again.
An hour passed.
Zhao Yi pressed his forehead hard, his brain felt unusually tired. He glanced at the energy value: [Energy: 61/104. 】
No wonder!
After looking at the code on the screen, he simply gritted his teeth and used four learning coins.
[Consume learning coins to increase your energy! 】
[Energy +40. 】
Although it is not difficult to earn learning coins, and I receive more than twenty coins every day, I am still not used to using them to replenish my energy.
Energy can be replenished while sleeping!
Using learning coins to replenish energy is like playing games to pay for experience. It is really too luxurious.
continue!
[Research Coin: 14. 】
[Use research coins to improve causal thinking. 】
[Scientific Research Coin-1, assists in improving causal thinking ability and obtains inspiration effect. Duration: sixty minutes. 】
After continuing to work for more than half an hour, Zhao Yi compiled twenty-one data analyzes of the input Rubik's Cube. After his fingers stopped, he subconsciously used the "Law of Cause and Effect" to measure whether the data was effective in restoring the Rubik's Cube.
Using this method, three irrelevant analysis data were eliminated, and the remaining eighteen types of analysis were all helpful in restoring the Rubik's Cube.
Next, continue to make judgments.
Whether a twist helps to restore the Rubik's Cube can be determined using the Law of Cause and Effect.
Find out several or more than a dozen twisting methods that are helpful in solving the Rubik's Cube, and compare them together with the analyzed data.
These are the conditions.
When all the conditions are perfected, the "Law of Contact" can be used to prove the process by which the conclusion is drawn.
This is the causal way of thinking.
First find the results and perfect the conditions, and the last step is to find the process. After you have the process, you can write code to express it.
Zhao Yi still ran into trouble.
Time, energy.
He has found the key to algorithm design, but based on a rough estimate, he needs to write at least several thousand lines of code. Based on his work efficiency, it will take at least ten hours.
"Forget it, go to bed first!"
"Continue tomorrow!"
…
Zhao Yi got up early the next day, turned on his computer and read the forum posts.
The post is extremely popular!
There are more than 4,000 replies below alone.
Because it involves hotly searched gossip, many media outlets on the Internet publish news and reprint the content of the post.
On the index list of the search website, a new related hot search was added, called 'Genius hacker lists data to reply to Jia Hongning', and the popularity jumped to third place.
This has to do with the content of the post.
In some controversial gossip incidents, most of the parties involved were interviewed and expressed their opinions and opinions. Even if they posted a reply, they would at most be breaking some news and gaining sympathy.
Zhao Yi's post is novel. His method of directly listing the data has greatly improved the style of gossip.
In addition, controversy is also the reason for the popularity.
The data listed on the post caused a lot of controversy. A well-known doctor of mathematics expressed his opinion, "The optimal steps to crack the third-order Rubik's Cube require an unimaginable amount of calculations. Ordinary home computers must not be able to calculate it."
He also said that "there is currently no practical and effective optimization algorithm."
at the same time.
There are also many voices supporting Zhao Yi on the Internet, believing that it is impossible for him to randomly tell the data. Some other professionals said that rough calculations cannot yield specific data, but they can judge that Jia Hongning's Rubik's Cube is simpler to restore than Zhou Junkai's. In some cases, especially in the last competition, the gap was even more obvious.
Zhao Yi felt it was time to stand up.
Although there are some voices supporting him, it may be detrimental to continue, and something should be done to guide public opinion.
It's time for school.
He decided to take Netbook to school and start posting at school.
The atmosphere at school is similar.
Because the matter involved students at the school, there was a lot of discussion in the school. Almost everyone knew about the post. Many people wanted to ask Zhao Yi how he calculated the results.
"Wait a minute, I'll write it out."
Zhao Yi went to talk to Sun Laoban and planned to use the self-study class to edit a post and publish it on the Internet to explain. Unexpectedly, Principal Wang Chengmin came directly to him.
"Zhao Yi!"
Wang Chengmin expressed concern, "I see that everyone on the Internet is talking about you. The data in your post..."
A group of people raised their ears.
Zhao Yi looked at He Ronghua a little depressed and said, "Lend me the Rubik's Cube."
"good."
He Ronghua immediately sent the Rubik's Cube over.
Zhao Yi looked at the Rubik's Cube in his hand, moved his fingers quickly, and completed the solution in about ten seconds.
Many people were stunned.
Zhao Yi turned his head and said to the people around him, "Help me count. Every ninety-degree turn counts once, and every one hundred and eighty-degree turn counts twice."
"good!"
A group of people watched carefully.
Zhao Yi deliberately slowed down the speed to make it easier for others to count. In almost a minute, he turned the Rubik's Cube seventeen times, then picked up the Rubik's Cube and said, "This is the Rubik's Cube before it was restored for the first time in Jia Hongning's competition. It took me seventeen steps to transform it, and I can transform it back seventeen times."
"Hiss~~~"
Not to mention other students, even Wang Chengmin took a breath after hearing this operation.
He immediately took Zhao Yi to the principal's office, "Come on! Come on! I'll take a video for you and post it online to see who doubts it again."
Zhao Yi smiled and followed.
He originally wanted to post a post explaining how to turn the Rubik's Cube, but it was too troublesome to describe it in words, and it was much easier to make a video.
Thanks to the book friends for the reward:
The Bear King, 300 coins.
Pluto Book God, 100 coins.
You'll Also Like
-
Pushing forward to be invincible: starting from adding points in the dream
Chapter 193 1 hours ago -
I can recognize everything, but the information is wrong
Chapter 243 2 hours ago -
Helping each other with countless me
Chapter 309 2 hours ago -
Solovyov in Tsarist Russia 1796
Chapter 624 2 hours ago -
Cultivation, I have a world of high martial arts
Chapter 273 2 hours ago -
The years when I explored the fairyland
Chapter 409 4 hours ago -
Turning danger into fortune: My adventures are a little bit weird
Chapter 549 4 hours ago -
Steady cultivation of immortality, the entire cultivation world is my home
Chapter 765 4 hours ago -
Star Rail Simulation, but surrounded by characters
Chapter 236 4 hours ago -
After I became the infinite flow boss
Chapter 255 4 hours ago