← Back to archive
Programming Notes

If We Represent the Generation and Overcoming of the Five Elements with an Adjacency Matrix

The generation of the Five Elements, taken as a directed cycle, can be expressed as:

   A B C D E
A  0 1 0 0 0
B  0 0 1 0 0
C  0 0 0 1 0
D  0 0 0 0 1
E  1 0 0 0 0

The overcoming of the Five Elements, taken as a directed cycle, can be expressed as:

    A B C D E
A  0 0 1 0 0 
B  0 0 0 1 0 
C  0 0 0 0 1 
D  1 0 0 0 0
E  0 1 0 0 0 

Clearly, in the adjacency-matrix representation, shifting the generation matrix one step to the right turns it into the overcoming matrix, and shifting the overcoming matrix one step to the right turns it back into generation.

And the one-step-right shift matrix is:

[[0, 0, 0, 0, 1], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0]]

Written by Master Sanfu on January 30, 2023. Please credit the source if you share.

Translation Notice: This English version was translated with AI assistance. Specialized, historical, religious, or culturally sensitive terms may contain nuances, inaccuracies, or debatable wording. In case of ambiguity or discrepancy, the original Chinese text shall prevail.